简体   繁体   中英

Steps to investigate battery drain issue on Android

I am working on an Android app now and now it is in beta release. However, a number of my beta users are claiming that they are experiencing battery drain, compared to before installing the app.

It looks like it is only impacting some users, but I am unable to pinpoint why yet.

I am using GPS and GCM in this application. I have followed the guidelines in Android Developers' documentation (removing the location client when onStop() is called). The app will not attempt to refresh data from the server if there is no network connection. However, I have some users saying that the app is in background all the time but the app drained more than 10% of the battery. (!!)

1) Should I remove the WAKE_LOCK permission associated with GCM?

2) What else can I do about the get Location? I am only calling getLocation in a few activities when they start. There is no interval update.

3) Any other potential battery drain culprits that I may missed out?

I have determined that the issue is linked to Wake Lock used in GCM implementation.

It looks like after the device is woken up after receiving a push notification, it is not going back to sleep properly.

Thanks for the responses. I am posting this and hope this help anyone who may have the same issue.

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