Skip to content Skip to sidebar Skip to footer

Android Deep Sleep And Wake Locks

I have created an android app which runs fine in all phones. But in my Alcatel phone it doesn't as the phone goes to a deep sleep mode and the data network fails so the app doesn't

Solution 1:

The lock you have in your service never runs - cause your service is never run

Well - you have to use a WakefulIntentService - make your MyDataService extend WakefulIntentService and in your receiver call WakefulIntentService.doWakefulWork(context, MyDataService.class)

Or implement a static lock shared by both your service and receiver - which would be tricky.

If using wifi you should also need to use a WifiLock - inside your wakeful intent service - can get tricky


Post a Comment for "Android Deep Sleep And Wake Locks"