Questions tagged [wakelock]

Refers to PowerManager.WakeLock, a class from the Android SDK belonging to package android.os. Its responsibility is requesting CPU resources in the context of power management. If no wake locks are taken, Android will shut down the CPU.

The Android Operating System uses its own power management scheme, built on top of the standard Linux one. Since it's mobile-oriented, one of its main goals is to avoid wasting CPU cycles (i.e. power) if no application is running.

That's why every application must request CPU resources, using wake locks. If no wake lock is taken, Android will shut down the CPU in order to save power.

Resources:

534 questions
0
votes
1 answer

Wakelock not working on Nexus 7

Hello everybody and thanks in advance for the help and time. Okay my problem is I have developed an application that shows a notification with a Service. I had to use a wakelock in order to display the notification when the screen is off. That…
Mazinger
  • 633
  • 1
  • 6
  • 12
0
votes
2 answers

Wake lock removed but screen still not turning off when app is active

I had the WAKE_LOCK permission in my app which I subsequently removed. But the phone still does not turn off the screen when my app is active. Is there any other setting that I might have that's preventing the phone from turning off?
Rajath
  • 11,787
  • 7
  • 48
  • 62
0
votes
0 answers

Intent Service stops when app crashes

I want my push service to run after specific interval to push data to server at a duration of 1 hour.but it stops pushing data after 1 day, or sometimes when the app crashes though service is a seaparate process as it extends intent -service …
0
votes
1 answer

Is wake lock commutative?

Let's say an Android application acquires a wake-lock, and then launches another application by sending it an explicit intent. Does the effect of acquisition of wake-lock last while the other application is in the foreground ?
bdutta74
  • 2,798
  • 3
  • 31
  • 54
0
votes
2 answers

Wake Lock doesn't work

I'm creating an alarm and using the WakeLock to wake the phone when asleep. I use this code for the wakelock in my Activity: public void onCreate(Bundle savedInstateState) { super.onCreate(savedInstateState); PowerManager pm = (PowerManager)…
stanley santoso
  • 343
  • 1
  • 6
  • 19
0
votes
1 answer

Wake Lock doesnt work

I'm trying to create an alarm with a list of time to go off that I already have stored in Parse. With the code I am using now, nothing happens when the time is met. I used to use a service that intents to another activity, but the wakelock doesn't…
0
votes
2 answers

Android Autosleep

Currently I'm locking at the Android Kernel and I'm wondering about the Wake lock mechanism. How and where is the interval time specified which defines at what point the phone will suspend. Is there a sysfs interface which passes a value (in…
Peter P
  • 491
  • 4
  • 14
0
votes
2 answers

Wake locks on my service and third party programs not working at all

I am making an administrative app for my work, but the problem is that i need to keep the device awake 24/7 so a service can send small UDP packets to my server. My Alcatel One Touch with android 4.2.2 falls asleep no matter what. I added a wake…
0
votes
1 answer

When the device is sleep IntentService is not getting called

I am Triggering an IntentService from WakefullBroadcastReceiver Intent i = new Intent(context, MyService.class); i.putExtras(bundle); Log.i("StartService","Before Wakelock"); WakeLock lock = MyService.getLock(context); …
0
votes
1 answer

RuntimeException (@android.os.PowerManager$WakeLock:release:***)

I get more than 20 errors with that msg in GoogleAnalytics: RuntimeException (@android.os.PowerManager$WakeLock:release:***) Android OS 2.3.* Who can to explaing me - how to fix the problem & why app crashing? My code: private PowerManager.WakeLock…
Suleiman
  • 1,003
  • 2
  • 15
  • 29
0
votes
1 answer

Wakelocks and paused app

In my application, I want to record the phone's location at fixed interval. To do that, I have a TimerTask to record the location on a regular basis and a WakeLock for the recording to continue even when the phone is aslept. My problem is that the…
VD63
  • 133
  • 1
  • 9
0
votes
4 answers

Android Timer which works on both background and foreground

I'm now working on an app which will track students' studying time. The student can press start button and start studying. And stop when he finish studying. When screen is on or phone is plugged in,the text view and progress bar is updating every…
Lin Lin
  • 259
  • 2
  • 14
0
votes
1 answer

Turn screen off when volume button is pressed

I've written an android program involving a counter that is increased by one when the volume button is pressed. It's also supposed to turn the screen off when this button is pressed and wait 5 seconds of inactivity before turning it back on. But…
OHS
  • 185
  • 1
  • 2
  • 12
0
votes
2 answers

Efficient way to acquire wake lock?

In my app i'm sending some data to the server in an regular interval (every 5 min)for this I used IntentService. IntentService checks for data and if data is available it sends that data to server. so here my question do i need to acquire wake lock…
Prachi
  • 2,559
  • 4
  • 25
  • 37
0
votes
0 answers

WakefulIntentService always getting killed in between execution

I am listening to incoming sms by WakefulBroadcastReceiver, which spawns a WakefulIntentService to log in that sms to google spreadsheet.But the problem is that the Intent service gets killed in between of execution, hence the writing of the sms…
rahulserver
  • 10,411
  • 24
  • 90
  • 164