Questions tagged [batterylevel]

The amount of charge remaining in the battery of a portable electronic device

The battery level of a portable electronic device is a reflection of the amount of charge remaining in the portable battery of that device. This is an indication as to how long the device can last without being plugged into a power source before shutting down.

262 questions
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
1 answer

How does Windows calculate remaining time on battery?

I'm testing an app to let users know when to plug and unplug their laptop to get the most life out of their laptop battery. As well as this I'm trying to replicate the tooltip from the Windows power meter. It's fairly successful so far with a couple…
Jamie Bull
  • 12,889
  • 15
  • 77
  • 116
6
votes
1 answer

Battery level c#

I have a method to determine battery level and kept a timer to periodically check the battery level. void GetBatteryLevel() { try { //Use this code in next build //System.Windows.Forms.PowerStatus…
Aster Veigas
  • 866
  • 3
  • 13
  • 34
6
votes
2 answers

How to get the battery power level in % in Java in a platform independent way?

How to get the battery power level in % in Java in a platform independent way? There is already a question for Windows for this: How to get the remaining battery life in a Windows system? And for Mac: Get battery level in Java But how can I do it in…
jobukkit
  • 2,490
  • 8
  • 26
  • 41
6
votes
3 answers

C#, Constantly monitor battery level

I am designing a program that depends on monitoring the battery level of the computer. This is the C# code I am using: PowerStatus pw = SystemInformation.PowerStatus; if (pw.BatteryLifeRemaining >= 75) { //Do stuff here } My…
Trontor
  • 417
  • 1
  • 7
  • 20
6
votes
4 answers

Android: ACTION_BATTERY_LOW not triggered in emulator. Receiver registered in code, not manifest

I have seen posts where it was mentioned registerReceiver has to be called (not defined in manifest) to receive ACTION_BATTERY_LOW intent. public class MainActivity extends Activity { @Override public void onCreate(Bundle…
Prasanna
  • 3,703
  • 9
  • 46
  • 74
5
votes
2 answers

Is there a battery level did change notification equivalent for kIOPSCurrentCapacityKey on macOS?

I am building a Swift app that monitors the battery percentage, as well as the charging state, of a Mac laptop's battery. On iOS, there is a batteryLevelDidChange notification that is sent when the device's battery percentage changes, as well as a…
TonyStark4ever
  • 848
  • 1
  • 9
  • 24
5
votes
1 answer

Fetch the battery status of my MacBook with Swift

I want to setup a Playground to fetch the battery status of my macbook. I have already tried the following: import Cocoa import IOKit import Foundation var blob = IOPSCopyPowerSourcesInfo() I am currently receiving an error as below Use of…
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
1 answer

How to get an array of images?

I want to make a Battery app which should notify the battery percentage to user in form of image. Now for battery percentage 0-100, I need 101 images in all. What I want to do is that is it possible to insert all these images in an array and use…
Aishvarya Jaiswal
  • 1,793
  • 6
  • 34
  • 72
5
votes
1 answer

Efficient Background service for tracking user location

I am developing a small android application in which I want to have Geolocation functionality. What I want to code is one service which gives the updated location of a user whether they are using my application or not. I know that if I am…
nilkash
  • 7,408
  • 32
  • 99
  • 176
4
votes
1 answer

How to detect battery level and status for charge log?

I am trying to do charge log for battery in android and it works fine. But the problem is that i couldn't detect the battery level and also the status of the charger. For your information, i am a beginner in using android and hope someone could help…
4
votes
3 answers

PhoneGap Build application doesn't fire battery-related events

I have a phonegap-bootstrap project at GitHub -- a demo application, written in PhoneGap 2.9. I've placed event handlers for every event supported by PhoneGap. All of them fires without any problems, except for battery-related events. I was more…
trejder
  • 17,148
  • 27
  • 124
  • 216
4
votes
0 answers

Best way to implement proximity alerts android

Hi I am developing android application and in my application i wanted to proximity alert for few location and those location are dynamic points mean location list can be change dynamically according users current location. so I implemented proximity…
nilkash
  • 7,408
  • 32
  • 99
  • 176
1
2
3
17 18