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

batteryStatus not displaying correctly

I am trying to display on an app if a phone is being charged by a plug, a usb cable or not charging at all. I am using the code below, it will display "charging via usb cable" if I am using a usb cable and it displays "not charging" if the phone…
Howli
  • 12,291
  • 19
  • 47
  • 72
0
votes
1 answer

Battery Level using System Management in C#

So I'm working on a speech recognition program in C# and I'v compiled a few lines of code that speaks back the current battery level when I say "battery Level". Only problem is, It doesn't work. Debugging stage it builds fine, no errors or warnings…
user2612049
0
votes
1 answer

How can i update in background my permanent notification?

My notification shows the battery level. When i close the app the percentage in the notification doesn't update its state. I don't know how i can do so now i post the notification code and i hope someone help me mNotificationManager =…
0
votes
1 answer

Android - Determine The Amount of Battery Life Remaining

Is there a way of accurately determining the amount of battery life remaining on the battery in hours/minutes? I know I can register an Intent receiver to receive the broadcast for ACTION_BATTERY_CHANGED and get the level and scale and use those to…
Brian
  • 1,184
  • 2
  • 21
  • 38
0
votes
0 answers

Battery Current - Refresh rate

I'm doing an application for a Samsung Tablet S10.1, and I need to have the battery current discharge values. I can obtain these values directly from the file "/sys/class/power_supply/battery/current_now", however they are updated only every 30s,…
0
votes
1 answer

Led notification preferences when battery is BATTERY_LOW?

How can i create a simple radio button preferences to choose which led color use in BATTERY_LOW condition?
David_D
  • 1,404
  • 4
  • 31
  • 65
0
votes
1 answer

How change image of my battery widget depending on battery level?

My widget is a battery level widget.. what i want is to display different images of the battery depending on battery level. Is this possible from my code? BatteryStatusWidgetActivity public class BatteryStatusWidgetActivity extends AppWidgetProvider…
David_D
  • 1,404
  • 4
  • 31
  • 65
0
votes
1 answer

Notifications bar lags when onGoing notification is on

My application has a notification in the notifications bar that shows the battery level. The notification works but when the checkbox in the preferences is clicked and the notification appears, i try to pull down the notifications bar and it lags. I…
0
votes
2 answers

Which is the difference between two methods to calculate the battery level in android?

in my application i display the battery level.. i get the battery level in this way: int level = battery.getIntExtra(BatteryManager.EXTRA_LEVEL, -1); And it's ok i can see the percentage.. but online i found another way: int level =…
David_D
  • 1,404
  • 4
  • 31
  • 65
0
votes
1 answer

How can i create .setTicker in my notifications bar

My notifications bar is structure in this way: Notification notification = new Notification(R.drawable.full,+level+"%",System.currentTimeMillis()); notification.flags = Notification.FLAG_ONGOING_EVENT; Intent…
David_D
  • 1,404
  • 4
  • 31
  • 65
0
votes
1 answer

How create a permanent notification to show battery level

I'm stuck in a creation of a notification..Just want display the battery level in the status bar(notifications bar)The notification has been permanent. This is part of code: private BroadcastReceiver batteryInfoReceiver = new BroadcastReceiver() { …
David_D
  • 1,404
  • 4
  • 31
  • 65
0
votes
2 answers

get how much time i have before the battery goes to 0% Android

Can i get how much time i have before the battery goes to 0%? Something using a CountDownTimer and making a stime of how much mAh the battery consume? Someone can help me to do it?
David_D
  • 1,404
  • 4
  • 31
  • 65
0
votes
2 answers

Crash onClick toggle button to disable wifi when battery less 20%

I've tryied this method to disable wifi on click of a toggle button when the battery is less 20% but the application crash on click: public void getRisparmio(View view, Intent intent) { // is the toggle on? boolean on = ((ToggleButton)…
David_D
  • 1,404
  • 4
  • 31
  • 65
0
votes
1 answer

How can i disable wifi when battery level is less 10%?

I'm writing an application that when the battery level is less of 10% the wifi connection (if activate) will disable. This is what i want but not what i am able to do :). I've created a toggle and when pressed the wifi stops and vice versa if press…
David_D
  • 1,404
  • 4
  • 31
  • 65
0
votes
1 answer

How to accurately obtain the iPhone battery level?

I want to get the battery level,and Accurate to 1%. I googled and find this, CFTypeRef blob = IOPSCopyPowerSourcesInfo(); CFArrayRef sources = IOPSCopyPowerSourcesList(blob); CFDictionaryRef pSource = NULL; const void *psValue; int…