I have a Cordova app, which I'm building for both iOS and Android. I'm using the HTML5 DeviceOrientation API (https://w3c.github.io/deviceorientation/) to obtain the device's orientation.
I install an event listener for "deviceorientation", and then process the event.alpha/beta/gamma values to determine orientation.
This works fine on iOS, but on Android it doesn't work. On Android, the "deviceorientation" event occurs only once, and the alpha/beta/gamma values are all null. Changing orientation after that does not result in any new events.
Has anyone experienced this? Any pointers on how I can debug?