Obtaining sensors data while the screen is off (Android 4.0+)

送分小仙女□ 提交于 2019-12-11 18:46:03

问题


As far as I know on Android devices there is no 100%-sure way to get the data from device sensors while the screen is off. There are some workarounds, but they do not work always. But all the posts I read were describing Android versions ~2.2.

Does anyone know whether the bug was fixed in Android 4.0+ ?


回答1:


This WakeLock works like charm.



来源:https://stackoverflow.com/questions/11612065/obtaining-sensors-data-while-the-screen-is-off-android-4-0

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!