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

Android persistent socket connection rules

I have been doing some testing for a custom push notification solution for Android devices using persistent sockets. I would like to share my findings and validate the results. Simple Description The applications runs a foreground service and…
Alex
  • 2,033
  • 1
  • 24
  • 40
33
votes
1 answer

Get battery level only once using Android SDK

I've searched on the web and couldn't find the answer to my question. My problem is to get the battery level information only once, eg. calling the function getBatteryLevel(). There are only solutions which are implemented using BroadcastReceiver,…
Karlen Kishmiryan
  • 7,322
  • 5
  • 35
  • 45
31
votes
2 answers

Getting the battery level of a Bluetooth headset on Mac OSX

I would like to know if it is possible to get the battery level of a connected Bluetooth device (for example, a headset) on Mac OSX. I'm looking for a command line or a library that would offer this possibility. Thanks.
Maxime Willinger
  • 449
  • 1
  • 4
  • 7
18
votes
7 answers

How to get real time battery level on iOS with a 1% granularity

I'm using this function to get current battery level of device: [[UIDevice currentDevice] setBatteryMonitoringEnabled:YES]; UIDevice *myDevice = [UIDevice currentDevice]; [myDevice setBatteryMonitoringEnabled:YES]; double batLeft = (float)[myDevice…
cat
  • 357
  • 1
  • 5
  • 14
16
votes
1 answer

How to get the battery level after connect to the BLE device?

I am developing an application where I have to connect to Bluetooth device on Android 4.3. And I want to get the battery level by using Battery_Service and Battery_Level. public class BluetoothLeService extends Service { private static final…
Wun
  • 6,211
  • 11
  • 56
  • 101
13
votes
3 answers

iPhone battery drain issue

I think my question will be useful for others. I have battery drain issue and want to find out where it is. I use xcode instruments: Enter profile then Energy Diagnostics, but I see nothing in energy usage section. How can I enable information in…
Paul T.
  • 4,938
  • 7
  • 45
  • 93
10
votes
3 answers

React Native Get battery status / level Using Native Modules

I am writing a react native app to get IOS and Android Battery status. I search through the net and found few libraries which can get battery level of the phone. https://github.com/robinpowered/react-native-device-battery…
9
votes
1 answer

how to determine battery level of airpods in swift

I have been learning about swift for sometimes. I have made an test app that shows user Battery Level and Storage details of the phone. Now i am exploring other possibilities. Is there anyway i can show the Battery Level of AirPods that are…
Nazmul Hasan
  • 123
  • 6
9
votes
2 answers

how to set battery % in android mobile using adb command?

If suppose 40% battery is available in my android device, what is the adb command to set the battery % to 30? Using adb command can set battery % only to lower level / higher level also?
RVR
  • 651
  • 2
  • 6
  • 14
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
8
votes
1 answer

Android programmatically get battery usage per application

android how to get battery usage per application. i have seen the applications that provides the battery used per application, but i do not find the api for this.reference link for the application application that perform the same
User10001
  • 1,295
  • 2
  • 18
  • 30
7
votes
5 answers

Get battery level JavaScript

/!\ THE USE OF window.navigator.battery IS STRONGLY DISCOURAGED AND THIS ISSUE IS NOW NOT WORTH CHECKING THANK YOU /!\ I want to get the battery level of the current system. Here is the output I intend to get: If desktop (no battery) Battery level :…
Anwar
  • 4,162
  • 4
  • 41
  • 62
7
votes
0 answers

How can I retrieve my own iOS app battery consumption programmatically?

Is there a public API that I can use to retrieve my own app battery consumption directly in the code like iOS is giving in settings app ? Example of what Apple can provide through settings…
craigzour
  • 123
  • 1
  • 9
7
votes
2 answers

Python script to charge and discharge laptop battery

A friend of mine recently inherited an old laptop and has freshly installed windows 7, and wants to increase the battery life. Initially the battery lasted around 20mins, but by manually allowing the battery to fully discharge before recharging, a…
Cornspierre
  • 322
  • 1
  • 5
  • 14
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
1
2 3
17 18