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
5
votes
1 answer

How to determine if OSX is on battery and not in power

I would like to adjust functionality of my app when in battery mode How to detect for an application it is in battery mode, etc. when the mode changes?
Peter Lapisu
  • 19,915
  • 16
  • 123
  • 179
5
votes
1 answer

C get battery life under Windows 7

I'm trying to code a program that gets the % of a laptop battery and then displays a CMD showing a message (for example: 10% -> "Low battery!"). I've tried to google it, and it seems they all tried with C++ or C#. Can anybody help me with C,…
5
votes
1 answer

Android : Is there anyway to get battery capacity of a device in mah?

I want to get battery capacity of a device to do some battery consumption computation, is it possible to get it somehow? For instance, battery capacity for Samsung Galaxy Note 2 is 3100 mah. Thanks for helping.
Vipul J
  • 6,641
  • 9
  • 46
  • 61
5
votes
2 answers

How to retrieve dual batteries status?

Dim power As PowerStatus = SystemInformation.PowerStatus Dim percent As Single = power.BatteryLifePercent or PowerStatus power = SystemInformation.PowerStatus; float percent = power.BatteryLifePercent; (I would prefer a vb answer as that is what…
GrahamTheDev
  • 22,724
  • 2
  • 32
  • 64
5
votes
2 answers

How to access laptop battery temperature in Windows?

I want to get the battery temperature in Windows, and I have tried DeviceIoControl function (http://msdn.microsoft.com/en-us/library/aa372698(v=vs.85).aspx) on the BatteryTemperature. I have tried other parameter like BatterySerialNumber, and it…
thinkinnight
  • 141
  • 1
  • 1
  • 6
5
votes
2 answers

How does persistent tcp/ip connections preserve battery and lower bandwidth usage?

In push notification mechanisms, like Apple's Push Notification Service, they use persistent IP connections. My question is, how does employing persistent connections save battery and bandwidth of a device? I am under the impression that since the…
Dj S
  • 10,232
  • 1
  • 21
  • 24
5
votes
1 answer

tree parser vs stream parser

Looking for an explanation on tree parser vs stream parser. From what i have been researching the JSON build-in parser in android is a tree parser and the Jackson Json parser is a stream parser. Also, android's xml pull parser is a stream…
j2emanue
  • 60,549
  • 65
  • 286
  • 456
5
votes
2 answers

iOS How can I get the battery level of the connected bluetooth device

AS you know , iPhone can get the battery level of connected bluetooth devices(not ble devices) and show it on the status bar . How can I get this information programmatically ?
user1338624
  • 174
  • 1
  • 10
5
votes
1 answer

What is the best way to get battery level on Android without permanently monitoring it?

I just need the battery level percentage at one point to print it on the screen, but I don't want to keep monitoring it afterwards. All code on the internet seems to listen for future changes, but I just need it once. What can be done to get it in a…
Sanziana
  • 189
  • 2
  • 2
  • 4
5
votes
1 answer

Battery efficient periodical data submission

I have a web application to be run on mobile phones that when open continuously generates data (a few kilobytes every few seconds or every few minutes depending on settings) and needs to push it to a server in real time. No data is ever sent from…
Mathieu
  • 61
  • 3
4
votes
2 answers

How to find out usage of battery in my application in android

can anybody tell How to find out usage of battery in my application in android
kumar
  • 645
  • 2
  • 14
  • 24
4
votes
1 answer

Will the iPhone battery affected with an open TCP connection and not sending or receiving data?

Im currently developing a chat client for the iphone. Server-side there is a node.js with Socket.IO and on the iPhone an Socket.IO client ( https://github.com/DanLite/socket.IO-objc ) My Question is: Will the iPhone battery affected with an open TCP…
hackfrag
  • 223
  • 3
  • 8
4
votes
0 answers

Measure battery usage for iOS from Xcode 14

There is a Energy Profile in Xcode 12. But can't see this any more in Xcode 14. And even more, it's always showing Insufficient Metrics Data for our 5k users app in Xcode organizer. I'm wondering what is the best way to measure the battery usage and…
Bagusflyer
  • 12,675
  • 21
  • 96
  • 179
4
votes
2 answers

iPhone running periodical process in the background - battery optimized way

I want to run a specific task in the background. This task takes few seconds to complete (it writes some GPS location data to a file). This task should run once every 1 hour. As I understand from the SDK, I do not have a way to INITIATE something in…
Gena
  • 187
  • 1
  • 12
4
votes
0 answers

Battery optimization not available on WearOS

I'm developing a tracking application that runs on Wear OS watches. I have some troubles when the watch goes to sleep. As soon as the watch goes to Deep Idle mode, all sensors acquisition stops. For that I'll need to whitelist the app using: Intent…