Questions tagged [batterymanager]

The BatteryManager class contains strings and constants used for values in the ACTION_BATTERY_CHANGED Intent.

The BatteryManager class contains strings and constants used for values in the ACTION_BATTERY_CHANGED Intent.

130 questions
0
votes
1 answer

Programmatically load battery saver screen on Samsung J3

I want to load battery saver menu from an activity programmatically on Samsung J3 device with android lollipop. I have tried the following snippet: Intent intent=new Intent(Settings.ACTION_BATTERY_SAVER_SETTINGS); startActivity(intent); but it…
Sabid Habib
  • 419
  • 1
  • 4
  • 16
0
votes
1 answer

Why is BatteryManager returning wrong value for temperature?

I am trying to integrate a BQ27531 battery gas gauge into a i.MX6 SoM. I loaded the drivers and everything looks good on the sysfs. When I run cat /sys/bus/i2c/devices/2-0055/power_supply/bq27531-0/temp, I get a correct value of 247 (which means…
0
votes
1 answer

Battery broadcast receiver declared in manifest doesn't work

I want to receive broadcast BATTERY_LOW, so I declared broadcast receiver in manifest (in order not to rely on current activity. I want my application receive this broadcast even when it's not running. Here's what I did.
Roman Diachuk
  • 31
  • 1
  • 4
0
votes
1 answer

Monitoring Battery Level programmatically in Android - BroadcastReceiver vs Handler

I was wondering, what would be a more efficient way to monitor the battery level programmatically in Android - using a BroadcastReciever that continuously monitors the battery level, or a Handler that checks the battery level every 10 minutes by…
0
votes
1 answer

Battery status in android

I need to make an application that determine the level of battery , if it's under 15% i'll make something. This is my BroadCast: public class BatteryChecker extends BroadcastReceiver { @Override public void onReceive(Context context, Intent…
iosamammohamed
  • 317
  • 3
  • 18
0
votes
0 answers

Using Power Profile can i calculate battery remaining time and discharge time in android

I am new in android and i make battery optimize application. I want to calculate battery remaining time and discharge time. And i also want to calculate Wifi, 3G Call, Movie, Music and Bluetooth time. I heard about powerprofile.xml to get wifi ,…
0
votes
2 answers

Battery & CPU usage & temperature measures results meaning

so i saw how to take CPU usage and temperature, i also have the Battery temperature and light sensor result. It's just that i get the numbers and don't know what does they say.. I understood that for CPU temperature 70C is high and 100C is…
0
votes
1 answer

Making code run continuously

I'm trying to make an app that does certain tasks according to a certain battery level (say a notification when battery level reaches 10%). The problem is when i launch it the app just checks the event once instead of continuous monitoring. e.g.…
codenamered5
  • 63
  • 1
  • 1
  • 10
0
votes
1 answer

How CPU-Z app gives max battery capacity ( in mAh) in Android?

This code gives me 2000 on every single device and all the previous questions of this problem on SO gives irrelevant answers. Please somebody help public void getBatteryCapacity() { Object mPowerProfile_ = null; final String…
0
votes
1 answer

How can I get "BATTERY_PROPERTY_CURRENT_NOW" to work?

I am trying to make an app where it will show battery status and battery information for one of my projects. I want to show the instantaneous current and source of power in the app but I have been unsuccessful to get it working, I dont get the…
sharf
  • 1
  • 2
0
votes
1 answer

Get battery level after every 1% accuracy in swift

I want to get the change in battery level after 1% accuracy in my iPhone. I want to do this in swift.
Rakesh
  • 1,177
  • 1
  • 15
  • 31
0
votes
2 answers

Null Pointer Warning - BatteryManager.EXTRA_LEVEL

I am attempting to get the device's current battery level with the following: Intent batteryIntent = context.registerReceiver(null, new IntentFilter(Intent.ACTION_BATTERY_CHANGED)); int level =…
advdev1234
  • 30
  • 8
0
votes
2 answers

Getting battery stats of all apps in android

I am working on a battery monitoring app in which I have to show battery usage for all apps. After a lot of googling I found there a only way to do so is using command line $ adb shell dumpsys batterystats --charged --checkin The above command will…
0
votes
1 answer

is my do loop code for java correct?

is this correct? im modifying a source code from github : USB CHARGE COMMANDER when battery goes down from 20 percent it will charge when batter goes 80 it wont and countdown timer is for it to do this every 5 mins i set 20000 just for testing …
1211asd
  • 11
  • 4
0
votes
1 answer

Where is the battery animation called from when wall charger connected to phone (OFF)?

I have Moto E (Rooted) which turn on when connected with USB via Laptop but not when connected to Wall charger instead it shows Battery animation. I got to know that battery animation is at framework-res.apk. Now I want to know from where it is…
Rohit
  • 810
  • 2
  • 9
  • 34
1 2 3
8
9