Questions tagged [battery]

A battery is a portable electrical power source which is often used in mobile devices.

battery
Filter by
Sorted by
Tagged with
6 votes
1 answer
1k views

Retrieve the computer's charging status & current battery level

I needed a VBA procedure to retrieve the system's current battery charge level and charging status. I was surprised not to find anything on Stack Overflow, and I eventually figured it out, so I'll ...
ashleedawg's user avatar
2 votes
1 answer
2k views

iOS 12 – The simplest way to obtain battery cycle count for iPhone

I know that public API at the moment allows obtain only two useful properties for battery: batteryLevel and batteryState. Even after WWDC 2018 there's no any changes. let batteryLevel = UIDevice....
Andy Jazz's user avatar
  • 53.9k
-2 votes
1 answer
74 views

Find battery temperature using Arduino Uno or Feather M0 [closed]

I want to run my project using battery. I am using Adafruit Feather M0 Bluefruit LE. I want to know can I face any issue with battery temperature and how can I keep a trace on the battery temperature. ...
MANU JAIN's user avatar
2 votes
2 answers
4k views

How to programmatically emulate battery in Windows workstation without battery device?

For testing purposes I need to force Windows to think that it has battery on workstation PC. Is there the way to fake/mock/emulate/simulate battery state/low level/charging/discharging in Windows ...
Oleg Neumyvakin's user avatar
1 vote
1 answer
1k views

Intent to Battery Launch section in Huawei with Oreo

I need to redirect the Huawei users with Android 8 "Oreo" to the new section Settings -> Battery -> Launch Anyone knows how to build the intent or where I could find the information (package and ...
javisilox's user avatar
3 votes
1 answer
222 views

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 ...
rick's user avatar
  • 1,009
12 votes
1 answer
2k views

What is exactly "Adaptive battery", and what does it mean for app developers?

Background Google has announced on Google IO 2018 something that's called "Adaptive battery": https://youtu.be/ogfYd705cRs?t=3562 As a user, this sounds promising, but as a developer, this could be ...
android developer's user avatar
0 votes
1 answer
170 views

How to automatically pause a GPS tracker when user is not moving

I have a two part question (1) How to pause activity tracking when user is not moving, (2) and can this save battery life? A bit more information. I'm building an activity tracker but for an activity ...
Chris_1983_Norway's user avatar
1 vote
1 answer
1k views

Using UDP versus TCP for Wi-Fi comm - battery drain?

I have several questions, but SO's practice is not to ask multiple at once, so i'll put the same intro and number them in logical order. I'm writing a business app that communicates with a .NET Win-...
Astrogator's user avatar
  • 1,049
1 vote
0 answers
438 views

Xamarin - IOS - Battery usage

I have developed an IOS application with Xamarin and am trying to find out what is consuming most significantly the battery. The application has three main activities: Listen to location updates in ...
Rabih Sarieddine's user avatar
0 votes
2 answers
13k views

Does low battery level stop the location service or make it fail to fetch the location?

Some of my users ran into an issue where they couldn't fetch the location using Location Service. In the screenshots they sent me, i noticed that the battery level was really low, like 2-5%. My ...
Ryan Ho's user avatar
  • 293
1 vote
1 answer
964 views

Can someone please explain Android BatteryManger parameters

I am confused about the Battery Manager Parameters. can someone please explain below points: BATTERY_PROPERTY_CHARGE_COUNTER - Battery capacity in microampere-hours, as an integer. Ques - Is it ...
kukroid's user avatar
  • 420
0 votes
1 answer
1k views

no battery detected, empty power_supply and acpi directories

there is no battery detected. there are no forums with the solution. I've edited grub to force acpi and i have nothing listed in proc/acpi/battery or /sys/class/power_supply. i have reinstalled with ...
Dave Slash Knoll's user avatar
1 vote
0 answers
142 views

Oreo and getting battery usage stats per app

I thought that 8.1 was introducing an API to retrieve battery usage per app? Is there a way to do this? I've used android.intent.action.POWER_USAGE_SUMMARY but it's quite limited.
narb's user avatar
  • 988
1 vote
1 answer
283 views

Observing or getting notified of change in battery state for watchOS

Is there any way to be notified of changes in battery state in real time without periodically checking for the state? I tried finding an equivalent to UIDevice....
Gevrey's user avatar
  • 51
0 votes
0 answers
55 views

How to Analyze the amount of battery being used by my Android App [duplicate]

I have developed an Android App. But sometimes I can notice that my app is consuming battery even when I am not even opening it once. The Battery consumption is more than 1 % and goes up to 5 % at ...
Rahulrr2602's user avatar
-2 votes
1 answer
418 views

how do I get instantaneous battery levels? (Android)

I am trying to sample accurate battery levels in my application but I'm really struggling. Currently I have: String s = String.valueOf(BATTERY_PROPERTY_CURRENT_NOW); batteryShow.setText(s); but just ...
user avatar
2 votes
0 answers
66 views

How to automate the battery usage analysis for iOS application

We have a requirement to automate the battery usage analysis, this analysis should be performed in automatic during build or can be done in perfecto.Xcode instrument have option to do battery analysis ...
user3608500's user avatar
1 vote
0 answers
48 views

Display Type of Charge

My Code Has 4 Different textviews that display 4 different text, the first 3 display True or false and the last one shows the % of battery 1 Battery charging 2 Battery UsbCharge 3.Battery AcCharge 4....
user3215990's user avatar
2 votes
1 answer
2k views

Is there a way to monitor battery usage in real-time in android studio?

There's an option to check the battery usage history presented here. But is there a way to monitor battery usage in real-time as done in the Android Profiler with CPU, memory and network?
gbruscatto's user avatar
0 votes
0 answers
208 views

Twilio Video Call - Battery drops very fast (1% per about one second) and device is very hot after 10 minutes

I am using Twilio's Programmable Video sdk for iOS video calling app. The video calling works well, but I face the this issue when I have a long time video call. I used full screen mode for iOS ...
ville310's user avatar
1 vote
1 answer
942 views

Android Battery Historian - docker: Error response from daemon: pull access denied for gcr.io/android-battery-historian

I really need to see the battery stats of one of the app I am working on. I have been following below steps from the official Android documentation. https://developer.android.com/studio/profile/...
Harsh4789's user avatar
  • 687
-1 votes
1 answer
269 views

Battery status of an external device on HTML5

I have a PIC18 that sends its Vcc level of battery charge on a mysql database. I was wondering if there is a script to display its battery-status on my website homepage. I mean something like a ...
Penny Wiz's user avatar
0 votes
1 answer
532 views

How can I programmatically determine battery health of an Iphone connected via USB

== UPDATED FOR CLARIFICATION == thanks for reading this! A MacOS Application called coconut battery is able to determine the following information: total battery capacity at the moment design ...
Fabian's user avatar
  • 35
3 votes
0 answers
565 views

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's user avatar
  • 2,887
7 votes
3 answers
10k views

android open battery settings programically

I'm looking for a way to open the battery settings screen from an android app. So far I found the two intents : Intent.ACTION_POWER_USAGE_SUMMARY Settings.ACTION_BATTERY_SAVER_SETTINGS but none of ...
user2679041's user avatar
2 votes
0 answers
370 views

Background Service in ionic 1 Taking too much battery consumption

I am creating an IONIC application for Android & iOS. As per my requirement, I need to call background service in every 3 hours interval. I am using cordova-plugin-background-mode cordoava plugin. ...
Deepanker Chaudhary's user avatar
0 votes
1 answer
617 views

MediaPlayer: Is whitelist battery optimizations allowed?

I am building a clock radio app which, on my device, running Android 7.1.1 stops playing after a few minutes (2.5 - 4 roughly) when the user presses the powerbutton to switch off the display. This is ...
Ben's user avatar
  • 265
2 votes
1 answer
1k views

Docker : Battery historian - Pull access denied or require docker login

I am following https://github.com/google/battery-historian I am trying to execute following commands on my Mac : $ docker run -p 5665:9999 gcr.io/android-battery-historian/stable:3.0 --port 9999 ...
AnswerDroid's user avatar
  • 1,883
1 vote
0 answers
162 views

No notification with my program started with systemd

I develop a small program in Python3 to test the level of my battery and send a notification when it exceeds a threshold. This my code: #!/usr/bin/env python3 import configparser, signal from ...
romain's user avatar
  • 11
0 votes
1 answer
83 views

Detect charge in android without battery

I have a device connected directly to the pins of the Tablet (for charge it), not the battery. This makes the Tablet is charging, although in reality the battery is discharged or with little charge. ...
Juan Huerta's user avatar
3 votes
2 answers
6k views

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 ...
ranjjose's user avatar
  • 2,138
1 vote
1 answer
509 views

adding an app to battery saver programmatically when the app is installed

i developed an Android application, it contains so much background services and it uses Medias unfortunately this app is draining the battery life fast i search the web but i didn't reach a good ...
evalboy's user avatar
  • 41
0 votes
2 answers
627 views

Android Wear: BleLEScan is draining my battery

I am developing an app which needs data from the wear. One of the type of data is BLE. I am using BleLeScan: BluetoothManager bluetoothManager = (BluetoothManager) getSystemService(...
Ritu Raj's user avatar
  • 543
-3 votes
1 answer
68 views

App that depletes battery fast - possible? [closed]

Is it possible to make an app that depletes a phones battery in a short period of time? (10-30 seconds) I'd like to know if that is possible for a command that can be initiated on my personal device ...
Beginner's user avatar
0 votes
0 answers
64 views

App needs accurate localization - huge battery drain

one of our programmers developed an app that needs some geotagging capabilities: the app is not a mapping one and does not need a constant knowledge of current user position the app needs to know the ...
frankieta's user avatar
  • 982
0 votes
0 answers
169 views

App causing battery drain, possible caching issue?

Just about finished with my first android app, but I noticed recently a pretty significant battery drain. It happens even after the app is closed, even after it's been force stopped, until the phone ...
amp502's user avatar
  • 1
2 votes
0 answers
1k views

Estimated remaining battery time / Charging time left

I was trying to figure out the way to calculate the Estimated remaining battery time of battery and this post did help me to do so but it isn't much accurate as the Android OS shows in: Settings > ...
Arslan's user avatar
  • 51
1 vote
2 answers
2k views

Tools available to analyze and benchmark the battery usage of android application

I want to accurately estimate the power usage of my android application. ie, analyze the power usage through the Network usage, GPS usage etc. I found that Battery Historian as a solution. But it ...
Stack User 5674's user avatar
0 votes
0 answers
185 views

Battery Usage for individual UWP Apps

I have a WPF .NET application written in C#. I'm trying to obtain the battery usage for each individual UWP app programatically as shown in the image below. I have looked at the Windows.Devices.Power ...
Keith's user avatar
  • 143
0 votes
0 answers
41 views

Android - Manufacturer specific battery saving

Im developing a chat app which uses GCM to notify the user of incoming messages. One problem I can't seem to fix is that every manufacturer seems to implement his own battery saving in addition to the ...
Michiluki's user avatar
  • 505
1 vote
0 answers
81 views

App's battery usage keeps rising at a constant rate even with the app closed and force stopped

I'm running my app (an alarm clock) on a pixel with android 8.0 and my app's battery usage in mAh keeps rising with no active or background use changes. It shows no running services and doesn't do any ...
spaceman's user avatar
  • 138
4 votes
0 answers
1k views

Android force idle mode vs. really unplug the device

Currently I'm working on an app which does Bluetooth scanning in background service. I realized that the phones behaviour is different if I force the device to sleep mode by adb shell dumpsys ...
Fintasys's user avatar
  • 1,359
3 votes
1 answer
664 views

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 ...
Nils Mackay's user avatar
0 votes
0 answers
137 views

How does the battery drain in Android when the phone search others?

I will make the app about searching periodically with a bluetooth in Android. The app is operating in background and the period may be too short, about 1 min. but i dont know how I decide that. I ...
Hopark's user avatar
  • 1
1 vote
1 answer
443 views

Getting GPS location Consumes battery

I am working on a android project where i have to get the current location of the user for every 2 minutes and the code we are using is try { DpGPSEnabled = DpLocationManager....
sunilkarkala's user avatar
1 vote
0 answers
121 views

System.__ComObject in Battery.FromIdAsync(id)

I am currently playing with Windows.Devices.Power. I have created a watcher for Bluetooth devices, and already retrieved the devices which were discovered nearby. But the problem is that when I try ...
L.V's user avatar
  • 151
0 votes
1 answer
38 views

Phonegap Battery cycle count

I would like to know the battery cycle count on my Phonegap app. But I can't find a way to have it. Is it possible with Cordova/Phonegap or should I use native code for each platform ?
L. Grolleau's user avatar
0 votes
1 answer
165 views

Android: diagnosing source of app's excessive battery drain with battery historian

I'm trying to identify why my alarm clock app's "app usage" under my battery settings is so high (~10%) with very light use given the fact that the app's "device usage" is only 1% (running on android ...
spaceman's user avatar
  • 138
3 votes
1 answer
945 views

Battery optimization dialog not working in Android Oreo

I'm using the following method to request whitelisting for my app: PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE); String packageName = getApplicationContext()....
Mister Smith's user avatar
  • 27.8k

1
3 4
5
6 7
18