Is it possible to detect phone shakes with B4A?

Steve

Member
Licensed User
Longtime User
Greetings,

I'm working on a small app that I want to run in the background on my phone. A trick I've seen other apps employ involves shaking the phone to execute a specific task: in some apps it shuffles music, and in others it toggles the state of a setting. I would like to be able to detect when the phone shakes and trigger a specific action inside my app. Can the PhoneSensors object be hacked around to make this work, or is there a specific Android API call which i should try to use to handle this better?

Thanks for any pointers.
Steve
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…