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
12
votes
5 answers

How can I programmatically stop a notebook battery from charging?

There is some easily available information on finding the status of a battery, or whether it's charging or not. (GetSystemPowerStatus API or System.Windows.Forms.SystemInformation.PowerStatus). I want to be able to stop a battery from charging based…
Marcel
  • 7,909
  • 5
  • 22
  • 25
11
votes
1 answer

Opening miui battery saver for specific apps

I am working on VoIP calling applications and calls are getting missed which are sent over FCM when battery saver is on on MIUI. This is happening very frequently. I want user to open Battery saver activity for my own app and give no restriction for…
Ifta
  • 1,536
  • 18
  • 25
11
votes
3 answers

Linux c++: apis vs /proc files?

Im working on an app to collect and send various bits of system info (partition space/free, laptop battery info, etc). Im not having much success getting this information in the form of direct c++ api.. though its all available via files in /proc…
ethrbunny
  • 10,379
  • 9
  • 69
  • 131
11
votes
0 answers

Any way to programmatically add an app to Samsung Unmonitored apps list?

Samsung Android 7.0 has the warning notifications for putting my App to sleep. This will even kill the sticky service. Is there any way to add my app to the "Unmonitored Apps". Or use intent to bring the user to this setting page at least.
Ziwei Zeng
  • 691
  • 5
  • 21
11
votes
1 answer

Determine Android phone's proximity to known point while conserving power

I am trying to determine if an Android user has had a close proximity to a list of predetermined locations. I'd like to do this with the least amount of drain on the phone's battery. The two mechanisms I see for accomplishing this are proximity…
ahsteele
  • 26,243
  • 28
  • 134
  • 248
11
votes
2 answers

Total Battery Capacity in mAh of device Programmatically

I have tried powerprofile of Android....I have tried this code...but it gives me 1000 answer every time in all the devices... Is there any other way in android to get battery capacity... Eg.if mobile device capacity is 2000mAh it should return me…
Jay Poojara
  • 121
  • 1
  • 1
  • 7
11
votes
2 answers

How Do I get Battery Charge Cycles from a connected iOS device?

I'm using MobileDevice.framework in an OS X application and I've been able to get how charged the battery of an iOS device connected over USB is using the AMDeviceCopyValue(device, domain, key) function with the arguments "com.apple.mobile.battery"…
ArtOfWarfare
  • 20,617
  • 19
  • 137
  • 193
10
votes
1 answer

Android 12 Battery optimization

I am trying to check if Android 12 is optimizing my app battery usage, so I used isIgnoringBatteryOptimizations method ( https://developer.android.com/reference/android/os/PowerManager#isIgnoringBatteryOptimizations(java.lang.String)). But…
AVEbrahimi
  • 17,993
  • 23
  • 107
  • 210
10
votes
0 answers

Battery consumption while TCP is open for ADB via wifi can connect

My question is related to ADB over Wifi. I've found an article: http://stuffandtech.blogspot.de/2012/03/android-quick-tip-adb-over-wifi.html and that works for me, but I would like to know if keeping TCP open all the time actually will cause any…
Andrew Kuch
  • 315
  • 1
  • 3
  • 8
10
votes
7 answers

Getting Battery Capacity in Windows with Python

I am looking to figure out both the current Battery Capacity and the Design Capacity. So far what I could get to work is using the Win32_Battery() class which doesn't give all the information I need (at least not on my system). I used the…
cwoebker
  • 3,158
  • 5
  • 27
  • 43
9
votes
1 answer

Detecting the device being plugged in

I would like to be able to detect whether or not the device is plugged in. I would like to be able to just query that the same way we can do for the connectivity state. Is that possible or do I need to create a broadcast receiver that listens for…
CaseyB
  • 24,780
  • 14
  • 77
  • 112
9
votes
2 answers

getting battery level at android widget

I wrote a widget for Android and I'm trying to get the battery level. I've tried using Intent batteryIntent = context.registerReceiver(null, new IntentFilter(Intent.ACTION_BATTERY_CHANGED)); but I get the error: "IntentReceiver components are not…
Ran
  • 4,117
  • 4
  • 44
  • 70
9
votes
2 answers

Create "Battery usage" intent android

On my nexus one, there is a handy app reachable from Settings > About Phone > Battery use. I'd like to StartActivity() that app from one of my Activities. I can see in the log that when Settings runs it, this intent is logged: Starting activity: …
Peter vdL
  • 4,953
  • 10
  • 40
  • 60
9
votes
5 answers

Android : Turn on a device programmatically

I have a smartphone connected to a solar charger. By day, it is powered correctly. But during the night, sometimes it turns itself off due to the lack of energy. My question is : It is possible to turn it back on (programmatically), when the battery…
Greelings
  • 4,964
  • 7
  • 34
  • 70
9
votes
4 answers

How to get battery consumption value for an iOS app (x mAh/min)?

I'm currently trying to improve the battery usage of the app we're developing. The only thing I found was percentage with a jailbreak solution (here), I did not find absolute value like 3.4 mAh/min as example. I also did not find iOS guidelines to…
Nicolas Henin
  • 3,244
  • 2
  • 21
  • 42
1 2
3
57 58