简体   繁体   中英

Android service running in background without sleep?

i'm doing a location grabbing service for my phone. The main activity sets some timing like 10min interval which results in the servicing running polling both gps and network location for the first 1 min then post the result in http then rest for the 9mins. The questions is, does the service get destroyed in deep sleep? if thats the case i'll have to use alarm manager for it?

It is not destroyed, it is sleeping. When you wake your phone up it must continue working and getting location updates.

You need to use AlaramManager or WakeLock

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM