Android continuing ACTIVE life cycle of an activity

In ANY map that I checked out, the coordinates of my phone is real-time, EVEN with locked screen.

here is the question:

in Life cycle of an activity, Locked screen mean Pause

, so its recommended to avoid using sources as in a active part of cycle, to prevent killing by the OS.but what I see in result is that, they simply work!

I thought they use a service to do that, but All I read is that it is not to rely on services and expect them to run forever in background. my question is what approach do they ( developer of these Maps ) have toward this ?

thanks in advance

Answers


How are you getting coordinates?

Service is appropriate way as you do not know when you will receive location change event, unless you want last known location.

Check here http://developer.android.com/guide/topics/location/strategies.html in sample code they use service to listen to location change. You register when to listen location change and unregister when done else it will consume battery.


Need Your Help

Firefox Password script same PW auto login for 1000s devices Possible to use greasemonkey

firefox greasemonkey scripting autologin

I currently work in a position that i have to manage and access 1000s of pages for troubleshooting and new setup.... and im trying to figure out a way for firefox or chrome to setup ANYtime it sees...

Does anyone know whats wrong with this DOM?

javascript html dom

I'm having problem with this code here, and I can't seem to find why.