Questions tagged [battery]

A battery is a portable electrical power source which is often used in mobile devices.

An electric battery is a device consisting of one or more electrochemical cells that convert stored chemical energy into electrical energy.

Each cell contains a positive terminal, or cathode, and a negative terminal, or anode. Electrolytes allow ions to move between the electrodes and terminals, which allows current to flow out of the battery to perform work.

871 questions
3
votes
1 answer

Battery optimization dialog not working in Android Oreo

I'm using the following method to request whitelisting for my app: PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE); String packageName = getApplicationContext().getPackageName(); if (Build.VERSION.SDK_INT >=…
Mister Smith
  • 27,417
  • 21
  • 110
  • 193
3
votes
1 answer

calculate app uptime - android

I am trying to get the power consumption details made by each installed app in a list. But since I do not have root access, I know I won't be able to use adb shell commands to get battery usage info for all processes. What I think I can do is get…
3
votes
1 answer

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.…
Pankaj
  • 833
  • 12
  • 35
3
votes
3 answers

Debugging battery warning

I have an app that connects to an external accessory via Bluetooth. Testers have reported that the connection gets dropped when "Low Battery" alert is displayed. This was reported on iPod touch 2nd gen., so it may be peculiar to that device. I am…
westsider
  • 4,967
  • 5
  • 36
  • 51
3
votes
2 answers

Android LocationListener polling interval

I have a Service that uses the LocationListener, and it will be running from boot, indefinitely. My question is, how often is too often to listen for location updates? Is 5 minutes a battery killer? What about 1?
zkwentz
  • 1,095
  • 5
  • 22
  • 44
3
votes
0 answers

AMOLED display does not save power with full black display. Why is it so?

I created an that shows black screen and installed it on Moto X (with AMOLED display). Put the phone in aeroplane mode. Then ran Trepn profiler app to measure power consumed. The total battery drain was 53.36 for 10 minutes. Then repeated the same…
prasannatsm
  • 900
  • 1
  • 11
  • 19
3
votes
1 answer

How to get percentage of battery usage by each app in android programatically

I am making a demo for battery usage percentage by all apps.I am able to get the total available battery percentage but want to get battery usage by percentage by each app separate.So Is there any way to do so as lot many apps are available in…
sulphuric Acid
  • 585
  • 6
  • 23
3
votes
1 answer

Windows Kernel32.BatteryLifePercent = 255

I'm trying to build a Java app that reads the status of a laptop battery and sends a notification to the user if it's low. In order to do this, I'm using jna with Kernel32 native library as explained in the first answer of this question: How to get…
Aurasphere
  • 3,841
  • 12
  • 44
  • 71
3
votes
3 answers

Battery historian cannot find end time android

I'm trying to use Battery Historian Python script from GitHub to analyze battery usage, but the html generated each time I use the script shows "cannot find end time". I'm following the steps form here. Here is a sample batterystats.txt file…
Rachita Nanda
  • 4,509
  • 9
  • 42
  • 66
3
votes
0 answers

Monitoring second battery in Android

Need a help from Android systems guru. We have an embedded project that consists of Android smartphone and custom embedded device connected via USB. Embedded device has its own battery and I need to monitor its status. Is it possible to register…
Alexander Dzyoba
  • 4,009
  • 1
  • 24
  • 29
3
votes
1 answer

Fetch Low accuracy GPS location when High accuracy is enabled

Is it possible to fetch location with PRIORITY_BALANCED_POWER_ACCURACY or PRIORITY_LOW_POWER even when GPS is of HIGH_ACCURACY using Google Play Services lib? Scenario here is I want to use location with high accuracy for some cases in my app, but…
bpsingh
  • 363
  • 1
  • 4
  • 18
3
votes
1 answer

How to get CPU or Battery usage per app in an amount of time

Is there any way that I can, over a period of say a day, see how much CPU (or battery) each app uses? Here's a sample from BatteryDoctor app: I think they did some works programmatically like: Get CPU time of an app Get Network Data Usage of an…
Chris Maverick
  • 928
  • 1
  • 8
  • 18
3
votes
1 answer

Retrieve battery uptime for android

Is there a way to retrieve the the amount of time since the battery has been charged? It doesn't appear like there is a way to do so with BatteryManager, but they show it to you in the settings. I see it here source , but it doesn't appear like…
John
  • 1,889
  • 6
  • 19
  • 26
3
votes
1 answer

TOTAL power consumption by Android App (CPU, GPS, Network, WiFi).

I am developing an application that tracks user movement using GPS and Network location information. I use Services, Activity Recognition, different sampling rates and gps/network timeouts for battery efficiency. The question is How can I measure…
mibrl12
  • 454
  • 5
  • 21
3
votes
1 answer

Strangest Thing Ever: Core Location staying active even when app is not running

This afternoon I walked my iPhone 4 into the Apple Store to see if they could help with a problem I've been having. Battery life hasn't been AT ALL what it should be--the battery drops 50% sitting on my desk overnight. Crazy. So I suspect I've got a…
Dan Ray
  • 21,623
  • 6
  • 63
  • 87