1

I'm making an HTML5 mobile game for my company. It needs to use devicemotion and device orientation to detect respectively shake and tilt. The game is in a webview so worst case scenario I can call it from the native counterpart. Anyway, device orientation should work on all android devices starting 3.0 according to this canIuse page: http://caniuse.com/#feat=deviceorientation But it does not on at least one of the devices we got, a Huawei y300-0100 with android 4.1.1 The tilting feature works on native applications but does not on the browser, including the demos from HTML5 rocks and the first one linked in the canIuse page. Thoses sames demos work well on a 4.0 samsung device we have. The window.DeviceOrientationEvent exists, and the event deviceorientation is call once, but all angles are at null instead of a value. And after this first call, you can move the device as you want, the event is not called again. Are you aware of some device that do not work with JavaScript deviceOrientation? Or do you think there is something wrong with this particuliar device?

  • https://stackoverflow.com/questions/35093857/device-orientation-api-returns-different-values-for-desktop-browsers I am testing on S4 GT-I9505 and S4 Tablet SM-T230 both running Android 4.4.2 and while using this API demo http://www.audero.it/demo/device-orientation-api-demo.html the GT-I9505 works showing changing values while the T230 does not work at all meaning all values are 0, not null. I am trying to check for devices that show a value of 0 but Firefox is not recognizing them for some reason and hence logic is broken. You have a way to separate devices that have value 0 and a real value? – lowtechsun Jan 29 '16 at 23:59

0 Answers0