简体   繁体   中英

Battery draining issue in my android application

We've a application which is using location manager and gcm push notification. Rest of components are like UI etc. Issue is that my application is using normal battery drain as expected when both push notification and location service is enabled. But now days with some devices, customers are reporting that my device is using unexpected battery draining and some time application's battery manager showing warning even.

As concern to Location, I'm using location manager with time and distance component under a android service. Gcm push implemention is simple as all other applications, like registering push and once push generated, getting push notification. So, I'm seeing only unusual thing in my app is that background service with location manager registered for significant location change (on behalf of time and distance). But when my application is not using location service, then also some time reported for battery drain. So, I wanted to know about the any tools that what is causing of battery drain in my app, is there any tools available? How can we identify that which part of application is cause of battery drain?

****Edit - I come to know by tester that it's happening on a specific device, which recently launched ie Samsung S7 Edge device. Is someone have any idea for similar issue reported?

You can use Battery Hisotrian

Battery Historian is a tool to inspect battery related information and events on an Android device running Android 5.0 Lollipop (API level 21) and later, while the device was not plugged in. It allows application developers to visualize system and application level events on a timeline with panning and zooming functionality, easily see various aggregated statistics since the device was last fully charged, and select an application and inspect the metrics that impact battery specific to the chosen application. It also allows an A/B comparison of two bugreports, highlighting differences in key battery related metrics.

You can find all info on how to use it, here

https://github.com/google/battery-historian

There is an amazing talk on this, the speaker deck is here

https://speakerdeck.com/ericbrynsvold/becoming-a-better-battery-citizen

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