Access accelerometer via Javascript in Android?

前端 未结 6 615
夕颜
夕颜 2020-12-02 23:51

Is there any way to access accelerometer data using Javascript on Android\'s browser? I know it supports \"onorientationchange\", but I\'d like to get everything.

C

6条回答
  •  盖世英雄少女心
    2020-12-03 00:33

    If you are trying to access the accelerometer from a webpage hosted on a server (verus one integrated into a native application through WebView), than the accelerometer data does not appear to be available as of now for Android. You can find a more detailed assessment here: http://www.mobilexweb.com/blog/android-froyo-html5-accelerometer-flash-player .

    You might also want to check out this SO post: Detect rotation of Android phone in the browser with JavaScript

提交回复
热议问题