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
7
votes
2 answers

Is there a way to turn off battery charging programmatically in OSX?

I read some articles about battery life, for example http://www.wired.com/gadgetlab/2013/09/laptop-battery/ And I am curious, could I manage battery charging process? Is there a functions to manually stop charging in OS X? I found IOKit that helps…
Dima Deplov
  • 3,688
  • 7
  • 45
  • 77
7
votes
2 answers

Is there a way to get battery info (status, plugged in, etc) without reading a proc/sys file on linux?

I want to get information about the battery in C on linux. I don't want to read or parse any file! Is there any low-level interface to acpi/the kernel or any other module to get the information I want to have? I already searched the web, but every…
musicmatze
  • 4,124
  • 7
  • 33
  • 48
6
votes
1 answer

Battery broadcast receiver declared in manifest file does not work?

There are two ways to make a broadcast receiver known to the system: One declares it in the manifest file with this element. The other is to create the receiver dynamically in java code. Now, the receiver has been created dynamically in java code…
Sodino
  • 587
  • 6
  • 16
6
votes
2 answers

How to remove the battery icon in android status bar?

I've removed the status bar which shows network, battery and time information in Android by take off the background image. But the icons are still there. Just wanna know how to remove the battery icon as well. Not for apps but for framework…
Jarmie
  • 75
  • 1
  • 1
  • 5
6
votes
1 answer

Exactly how much power is drained by registering a broadcast receiver for ACTION_BATTERY_CHANGED?

I am planning to write an app whose sole purpose will be to monitor the battery level, and launch an intent the moment it drops below a certain level. My one concern is that this itself will be a battery drain, and no one will want to use it. So my…
malfunction
  • 1,297
  • 2
  • 12
  • 18
6
votes
3 answers

How do I convert battery voltage into battery percentage on a 4.15V Li-Ion Battery in an Arduino IDE? (I am making some kind of LED Battery Indicator)

I know that battery discharge on a 4.15V Li-Ion is not linear, so I would like to have some equation that I can apply in my code to show the correct battery percentage. I can't find any good resources on doing this in an Arduino IDE. (Help with…
coyodha
  • 135
  • 1
  • 2
  • 10
6
votes
6 answers

How to get Bluetooth Headset battery level?

I'm trying to build an app which gets battery level of currently connected Bluetooth headset. This app can be used on phones which don't have this functionality built-in. While searching on stackoverflow, I found How to get Bluetooth Headset battery…
Sahil
  • 428
  • 2
  • 7
  • 15
6
votes
1 answer

Retrieve the computer's charging status & current battery level

I needed a VBA procedure to retrieve the system's current battery charge level and charging status. I was surprised not to find anything on Stack Overflow, and I eventually figured it out, so I'll share the code here as a Q+A.
ashleedawg
  • 20,365
  • 9
  • 72
  • 105
6
votes
8 answers

Stopping and starting a Service based on application state

I have a Service which tracks the location of the user. Currently, the Service boots when the application starts and stops when the application terminates. Unfortunately, if users keep the application in the background, the Service never stops and…
Andrew
  • 20,756
  • 32
  • 99
  • 177
6
votes
2 answers

Reading Battery Status on Linux/Ubuntu using QT

I am currently developing an application using qt targeting a tablet running ubuntu 14.04 Since there is only a poor battery indicator on the device and the application will run fullscreen for prolonged time, I want to show an battery indicator…
Andreas Wilkes
  • 993
  • 9
  • 16
6
votes
1 answer

iOS - Programatically get battery usages of an application

I want to get battery usages of an application programmatically. iOS 8 provide battery usages monitor utility and I want to know how did Apple implemented this feature. Is there any public API for this ? I want battery consumption value for my iOS…
Santosh Kumar
  • 71
  • 1
  • 6
6
votes
2 answers

Beacon Ranging vs GPS tracking battery usage

I'm looking at implementing a beacon based app to do some location tracking based on beacon placement. From what I've read and understood, beacon monitoring is fairly innocuous on battery life but ranging definitely takes a bigger hit on battery…
Eric B.
  • 23,425
  • 50
  • 169
  • 316
6
votes
1 answer

context.registerReceiver returns null intent when trying to check if power source is connected

I am trying to check if power source is connected for Android devices. The following is the logic(based on a stackoverflow post by Commonsware), Intent intent = context.registerReceiver(null, new IntentFilter( …
Ray
  • 16,025
  • 5
  • 31
  • 51
6
votes
2 answers

Pubnub push notifications & battery life on Android

We're writing a chat app and have got the Pubnub service running in the background, listening for messages and firing a Notification Intent on receipt. The problem is that we're using a partial wake lock when the phone is sleeping and that just…
sapanda
  • 792
  • 1
  • 9
  • 17
6
votes
4 answers

Determine specific charger input

I am currently trying to make a reliable way to determine a specific charger type, in my case a music dock like this. The problem is that this dock unfortunately does not send a dock event when docked. Since I am making an app relying on being able…
Magakahn
  • 498
  • 9
  • 31