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

Function for checking time and date?

I want to write a program that checks the time and day of the week and then switches operation modes for an energy management system based on that information. The program needs to be running and checking the day and time continuously every day…
0
votes
1 answer

How to get battery overall health in android?

Given eg a Honeywell CT40 handheld, in its settings there is a separate section dedicated to the battery and all of its details (usage, capacity, temp, cycle and even SN), and there is shown the battery's overall health in percentage. Is it possible…
0
votes
1 answer

android app to show notification when battery level is above certain percent

I want my android app to show notification when the battery level is above certain percentage which is similar to low battery notification in android. Not by assigning a background task which keeps checking battery level in background between every…
0
votes
1 answer

What is the best and most suitable way to save data in android?

My application collects data about the battery. I need to be able to edit this data with add/remove options. What is the most suitable way to store this data? I though about two ways: XML file or data-base using SQL.
Alex K
  • 5,092
  • 15
  • 50
  • 77
0
votes
1 answer

Android Beacon Library: Keep BeaconTransmitter running "forever"

is there any way to keep a BeaconTransmitter instance sending forever? The Problem: I want a RPi detect when I am coming home independent of Wifi running or the RPi even having access to the internet (e.g. it could then turn on all routers etc.,…
0
votes
1 answer

I trying to create a passive cell balancing using matlab but the state of charge in my cell 4 unable to balance

Below is the code in my matlab function I am trying to get the minimum state of charge among the 4 battery cell and trying to balance the battery in order to get all the battery in the similar range of state of charge but cell battery 4 is not…
0
votes
1 answer

HP BIOS Battery Health Settings

I am attempting to change the BIOS battery charging settings with PowerShell and will eventually deploy it using Intune. I am interested in doing this because I have some users that leave their computers plugged in full-time and it ruins the battery…
John
  • 11
  • 3
0
votes
1 answer

Can't get charging state

I am trying to get informataion from battery. So i've created BroadcastReceiver, to read this values in background. I've got the problem with get isCharging state from battery. I've got always false. I am trying to use this code: public class…
dirlender
  • 3
  • 2
0
votes
1 answer

How to get battery percentage based the timestamp in android?

How to get battery percentage based the timestamp in android? Is that possible to get the battery percentage based on the date timestamps? I'm trying to get the battery percentage based the time which I have spent time on the apps. In Android/Java…
KARTHIK MB
  • 11
  • 4
0
votes
1 answer

Android application how to check if i am not using too much Battery

How can i check if my apk that i created is don't use too much of the battery and not arm the usage of the battery itself. Is there any tests or code to do or add for that? Thanks
0
votes
1 answer

how to show toast only one time (in a non-repetitive manner) using broadcast receiver?

Please note: I am running this whole code in a backgroundService. All I want is to show a toast message (only once each action) whenever I connect to USB or AC Adapter in my phone, but the problem comes when toast message if repeated automatically…
0
votes
1 answer

how to make register battery Broadcast work in Manifest instead of in an Activity

I am trying to get actions performed on battery change. For that I have used the following code: public class BatteryBroadcastReceiver extends BroadcastReceiver { DatabaseHelper db; @Override public void onReceive(Context context, Intent intent)…
0
votes
2 answers

Simulate Battery State

I am creating an activity which seeks to change the state of LEDs on a device. The LED behavior is handled through an embedded controller with no APIs exposed, so I cannot directly change the state of the LEDs. The state changes based on the…
jjo
  • 154
  • 2
  • 14
0
votes
1 answer

Is there any way to keep a permanently disabled battery optimization for an app?

For a good execution of my app it would be needed that the mentioned battery optimization were permanently disabled. I already know how to ask for the permission and enable it, but problem is that the user is able to disable it later by himself or…
mylket
  • 147
  • 7
0
votes
1 answer

How does a device report the difference between BATTERY_PLUGGED_USB and BATTERY_PLUGGED_AC to BatteryManager?

I understand there are two different flags and they represent whether the device is plugged into AC or USB charging. How does the device know that, and what does it report to the operating system? I would have thought the OS could not distinguish…
faradaic
  • 3
  • 1
1 2 3
8 9