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
1
vote
1 answer

Do I save battery if I set CameraPreview visibility to GONE?

I have a simple class called CameraPreview, this is the code: public class CameraPreview extends SurfaceView implements SurfaceHolder.Callback { private SurfaceHolder mHolder; private Camera mCamera; public CameraPreview(Context…
Alex Pi
  • 21
  • 4
1
vote
1 answer

Does ObjectAnimator drain bettery

I am using ObjectAnimator to create an Animation in the background of my text.I have a frameLayout containing 10 views which uses ObjectAnimator to create a random animation. This frameLayout is used as background to a text view. I observed that…
Pankaj Goyal
  • 103
  • 1
  • 11
1
vote
1 answer

Since I activated BLE State preservation my app drains all the battery

I got an app that is connected to a BLE peripheral. It implements state-preservation and restoration for BLE and keeps the connection in background. When I leave the phone next to the peripheral the peripheral shows that there is an active…
mm24
  • 9,280
  • 12
  • 75
  • 170
1
vote
1 answer

Battery level notification not working when app is in background mode

I have implemented local notification for checking battery status. If the battery level is drop by 1% then local notification is received.This works for both i.e. app is in foreground or background for iOS version below 9. When I update device OS to…
1
vote
1 answer

Android - Getting battery level null when first time ask

I am trying to get battery level from a service. I am getting level successfully. But I have one problem. And that is when I try to get battery level for the first time then I get null. But when I ask after some seconds later, then I get exact…
1
vote
1 answer

How to detect remaining battery power through android programming?

I am working on battery saver app. There I need to detect remaining battery. I have done following. public class HomeActivity extends Activity { TextView tv_battery; @Override public void onCreate(Bundle b) { super.onCreate(b); …
D-JOhn
  • 23
  • 5
1
vote
4 answers

Script to check battery status variable and use it in if statement, and is there any script to make .bat file run as a hidden process every minute

Currently, I am trying to create a script file that will launch other programs if it detects that the laptop is running using its battery, not the AC. Providing that I am using Windows 8.1. I created a .bat file and I entered the following…
1
vote
3 answers

Pebble Watchface Battery Indicator

I'd would like to add a battery indicator to my Pebble watch face that will indicate the battery-level of my Pebble watch. I know that I could get it right if I used the documentation found here:…
Barry Michael Doyle
  • 9,333
  • 30
  • 83
  • 143
1
vote
3 answers

Get the exact battery level on android

So I currently have the following commonly used method of acquiring the current battery level implemented in my android app. int getBatteryPercent(){ IntentFilter ifilter = new IntentFilter(Intent.ACTION_BATTERY_CHANGED); Intent…
JayB
  • 397
  • 6
  • 21
1
vote
1 answer

How to check battery capacity Android Wear (API level 20)

I would like to readout the battery capacity left from my Moto 360. I've come along watch faces that show this value, but I was wondering how to get it. I would like to display this value on my own watch face i'm creating. From API level 21 it is…
patrick
  • 1,282
  • 4
  • 21
  • 37
1
vote
4 answers

How do I get the battery percentage in Batch?

So, I just want to know how to get the battery percentage in Batch. I think it would be good if the format was like this: :forever get-battery if "%battery%"=="100%" goto reached100 goto forever :reached100 echo Your battery has finished…
zulc22
  • 337
  • 2
  • 7
  • 17
1
vote
2 answers

Android Low Battery Level

I am writing an application to stop a a service during low battery.I am able to do that provided the application is launched and is running and the phone has sufficient battery level.The service is stopped using broadcast receivers when battery…
1
vote
1 answer

How to get android battery level from ubuntu?

I'm trying to access the battery life of my android phone (Samsung Galaxy Y S5360) from my pc (im running ubuntu 14.04), but i can't find anything relevant and so i was wondering if there are any linux/unix tools for getting the battery life or…
ahk
  • 59
  • 10
1
vote
2 answers

Current Battery State always returning "Charging" in ios

I am getting battery state as UIDeviceBatteryStateCharging even though my iPhone battery is 100% charged. It should give me state as UIDeviceBatteryStateFull. My code is as follows. [[UIDevice currentDevice]setBatteryMonitoringEnabled:YES]; int…
Rakesh
  • 1,177
  • 1
  • 15
  • 31
1
vote
0 answers

Battery check in background every n seconds

I need to run a battery check every 5 to 10 minutes, and if the battery level is lower than some percentage, I need to send a push notification. This check needs to be run even if the app is running in the background. Is it possible for me to run…
user2559108