bahar_p
bahar_p

Reputation: 441

Android battery usage - Details

I have a background Android application that listens to network-based location. In some scenarios it start doing some tasks, but only for a short time and then returns listening to network-based location changes (NETWORK_PROVIDER).

When I look in the battery usage screen, it always seems like it work a lot. My App

The "Stay awake" shows that the app works a lot where it should have shown that it does not work at all (almost..). When comparing to another popular app, I see that the "Stay awake" shows very little time, although the app is in the foreground and it is defiantly working! Other App

The other app also uses network but it does not show any data usage(Data sent/Data received).

Can someone please explain what each of the items under "Use details" means? Why "Stay awake" does not really reflects when the app is awake?

Thanks. PB

Upvotes: 2

Views: 884

Answers (1)

Kumar Rangarajan
Kumar Rangarajan

Reputation: 431

The "Stake Awake" here represents the time your app held a wakelock (both partial and full wakelock). Wakelocks force a device to be awake. Note your device can goto sleep even when a app is in the foreground (technically it could be considered running, but practically it might be doing nothing). Basically if the app is just waiting for user input and the display is turned off, the device might goto "Deep sleep". But any app (including background apps) could grab a wakelock and cause the system to not goto sleep.

Use an app like "Wakelock Detector" or a profiling tool like Little Eye (disclaimer: I co-founded the company building this tool) to understand how your app is using wakelocks.

:-)

Upvotes: 1

Related Questions