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
3
votes
0 answers

What should I use instead of navigator.getBattery()

I am looking for a navigator.getBattery() alternative. What I want to achieve is, that when you have under 30% of battery and you're not charging, it tells you to go charge. Right now I have this: navigator.getBattery().then(function(battery) { …
thisistemporary
  • 102
  • 1
  • 9
3
votes
4 answers

How to get Bluetooth device battery percentage using PowerShell on windows?

I am trying to plot a graph for Bluetooth headphone battery discharge. For that I need to read battery percentage of the connected device. I can see power information is available on GUI for the device. Is there any way to get the battery percentage…
Mahesh Mankar
  • 231
  • 3
  • 16
3
votes
1 answer

Adding battery management to anylogic model

I've a question, in my model I want to add battery information to the transporter fleet. Think about when the battery level is below 30% the AGV moves after finishing a task to the closest charging station and stays there until the battery level is…
Aron T.
  • 448
  • 2
  • 7
3
votes
1 answer

Android: Determine where app is draining battery?

My app is draining a lot of the battery, but I don't know what in my app could be causing this. What is a good way for me to determine what part of my app is causing such a huge drain on the battery? EDIT : So I found out my Location Listener was…
Hank
  • 3,367
  • 10
  • 48
  • 86
3
votes
1 answer

Disable Battery Optimization through REQUEST_IGNORE_BATTERY_OPTIMIZATIONS

We have an app on Play Store, which is used by businesses for field service. This app provides location updates of the users to our servers on a regular interval. The location data is used to calculate the amount of time spent by a user in a…
Vishal Goel
  • 170
  • 1
  • 1
  • 10
3
votes
1 answer

How to use Gekko for trajectory optimization in discrete time

I am trying to use Gekko to optimize (dis)charging of a battery energy storage system. Electricity prices per hour EP, energy production from solar panels PV, and energy demand Dem are considered over the entire horizon (0-24h) to minize total costs…
Robert_RP
  • 55
  • 5
3
votes
0 answers

How to fix extreme battery drain with NotificationListener service

I need to check the current unread notifications for my app and I was using a notification listener service to do this. However this solution seems to continually check for notifications in the background causing huge battery drain issues, 23%…
3
votes
1 answer

How can I find out what's wrong with a bugreport file

I have generated a bugreport.txt using adb bugreport > bugreport.txt. When I upload it to battery historian I get the error message: bugreport.txt does not contain a valid bugreport file How can I find out what's wrong with the file? I use android…
hilma
  • 31
  • 4
3
votes
2 answers

Getting the battery level

I know there are many questions like this, but I need a concrete answer whether it is possible or not. I want to get the current available battery power in mAh for any android phone. It is crucial for my project. I tried…
OwnageByte
  • 94
  • 1
  • 7
3
votes
1 answer

Programmatically stop/start charging rooted Android LG K4

I found the file sys/devices/platform/battery/LGBM_AtCmdChargingModeOff which has the value of "0". When I set it to 1, the phone stop charging. String command1 = "chmod 777 /sys/devices/platform/battery/LGBM_AtCmdChargingModeOff;"; String command2…
Eran Shay
  • 107
  • 1
  • 1
  • 8
3
votes
1 answer

ACCESS PERMISSION to read "/sys/class/power_supply/Battery/current_now" in Android Studio (Huawei P20)

everyone. I tried to access file "/sys/class/power_supply/Battery/current_now" to retrieve the battery current in Huawei P20. f = File("/sys/class/power_supply/Battery/current_now"); if (f.exists()) { return OneLineReader.getValue(f,…
Minipika
  • 31
  • 1
  • 2
3
votes
1 answer

Why Apple Created isBatteryMonitoringEnabled?

To monitor battery state and level, app should first enable isBatteryMonitoringEnabled property and set it true. But why this property created? You can set it to false or true wherever you want and system does not interfere in monitoring ever. Is…
rick
  • 1,009
  • 2
  • 10
  • 28
3
votes
0 answers

Ignore Battery Optimisation not working on Oneplus 5

Currently using powerManager.isIgnoringBatteryOptimizations(getPackageName()) for devices running api >= 23. And requesting user to allow my app to be not optimised by using Intent intent = new…
Aalap
  • 2,847
  • 2
  • 26
  • 24
3
votes
2 answers

Battery drain via Google Play Services persists after location services are used in Android

I'm using location & activity recognition features of android. Used for realtime location tracking. Currently using the latest ConnectionLess APIs. I have encountered the following problem: After starting the location, activity services, once in a…
ranjjose
  • 2,138
  • 1
  • 24
  • 46
3
votes
1 answer

Battery usage info for longer than a day

I want to get battery usage data from my OnePlus 5 over a longer period (months), to keep track of how much I use my phone. I've been playing around with adb and the batterystats dump, like so: adb shell dumpsys batterystats >…
Nils Mackay
  • 431
  • 4
  • 14