accelerometer - Android Workaround for non-working sensors when screen is off -


[edit: removed mention of android version - issue present on versions of android]

background: when screen off, many android phones not provide updates applications of accelerometer readings calling onsensorchanged() when screen off. behavior discussed on s.o. , further documented here http://code.google.com/p/android/issues/detail?id=3708

on phones (nexus s, droid x2, ...) accelerometer values provided when there significant change in value. sitting still on table, example, there might 1 or 0 updates per minute

in order produce code robust across phone models, how distinguish between lack of update events per screen off, vs. lack of updates per non-movement? should maintain database of phone models?

this hard detect. android's api provides way control wake lock. manufacturers have done terrible job of implementing os on side. terrible. need grab partial_wake_lock keep phones cpu running when screen turned off.

however not devices use , not respond - half/half respond - , respond great.

after reading comments above can tell majority of devices 2.3+ have used still not implement partial wake lock still.

i not rely on manufacturer controls because market fragmented. try find way functionality i'm looking different solution.

hope helps.


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -