获取传感器的数据,而在屏幕关闭(Android 4.0以上版本) [英] Obtaining sensors data while the screen is off (Android 4.0+)

查看:220
本文介绍了获取传感器的数据,而在屏幕关闭(Android 4.0以上版本)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

据我知道在Android设备上没有100%-sure方式来获得设备传感器的数据,而屏幕是关闭的。有一些解决方法,但他们并不总是工作。但是,所有的帖子我看了在描述版本的Andr​​oid 2.2〜

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.

有谁知道缺陷是否固定在Android 4.0以上版本?

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

推荐答案

激活锁定的工作方式类似魅力。

This WakeLock works like charm.

这篇关于获取传感器的数据,而在屏幕关闭(Android 4.0以上版本)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆