Some of the Android OS versions have a bug which stops thesensorssuch as theaccelerometerrecording when the screen lock is on.

The bug has been submitted but has not been fixed in all instances

http://code.google.com/p/android/issues/detail?id=3708

http://code.google.com/p/android/issues/detail?id=11028

Below is a list of Phones and OS versions the do and don’t have the bug + some are reported to be intermittent.

Bug No Bug Intermittent
Motorola Milestone – 2.1 Google Nexus One – 2.2 Google Nexus One – 2.2
Nexus One – 2.1 T-Mobile G1 – 1.6
HTC Desire – 2.2 Google ION – 1.6
HTC EVO 4G – 2.2
Motorola Droid – 2.2
HTC Eris – 2.2
Droid Incredible – 2.2
HTC Legend 2.1
HTC Wildfire 2.2

Update:There are a couple of workarounds that i have found

The first works for all phones but is a drain on the battery and involves keeping the screen on all the time. It changes the timeout of the screen to a higher number:

http://stackoverflow.com/questions/1114270/android-screen-timeout

The second seems to only work on some phones such as the Milestone and Droid which registers the sensor, then un-registers the sensor when the screen is off and re-registers the sensor. Long winded but if it works…

http://stackoverflow.com/questions/2143102/accelerometer-stops-delivering-samples-when-the-screen-is-off-on-droid-nexus-one

If you enjoyed this post, make sure yousubscribe to my RSS feed!

更多相关文章

  1. 代码中设置drawableleft
  2. android 3.0 隐藏 系统标题栏
  3. Android开发中activity切换动画的实现
  4. Android(安卓)学习 笔记_05. 文件下载
  5. Android中直播视频技术探究之—摄像头Camera视频源数据采集解析
  6. 技术博客汇总
  7. android 2.3 wifi (一)
  8. AndRoid Notification的清空和修改
  9. Android中的Chronometer

随机推荐

  1. Android—React Native编程
  2. 《Android开发艺术探索》第十章Android的
  3. Android入门教程(五)之------第一个Andro
  4. Android(安卓)零散知识点整理
  5. Android(安卓)事件处理
  6. Android(安卓)的变形矩阵 -Matrix
  7. Android(安卓)滑动效果高级篇(七)—— 华丽
  8. 理解Android回调函数
  9. Android(安卓)位图(二) Bitmap
  10. [置顶] Android(安卓)NDK开发轻松入门