Questions tagged [battery]

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

Filter by
Sorted by
Tagged with
0 votes
1 answer
43 views

How to disable battery and only use plugged in charger on Android?

I am using my phone for tethering and because of that have to charge it several times a day. My charger is plugged in constantly and it seems that this incurs battery wear. Is there any way for me to ...
Gear54rus's user avatar
  • 207
0 votes
0 answers
12 views

how to measure the battery usage for android process running in shell

I need to calculate the power consumption of running an artificial intelligence model on a mobile phone. I can currently only do this by running run.sh in the shell or put it into an application. I'm ...
Winnietheking's user avatar
0 votes
1 answer
47 views

Implementation of Battery in Android Emulators Under Maui

Is there a setting or permission missing? When we execute the code if (Battery.Default.PowerSource == BatteryPowerSource.Battery) the thread in which it is running vanishes and does not throw an ...
DumbestGuyOnSaturn's user avatar
0 votes
0 answers
16 views

Find CAN protocol for EnerDel EV battery

Acquired a number of EnerDel 355v, 17.7kWh EV batteries only to find that they went bankrupt a few weeks earlier and all the information and contacts dried up. I'm trying to find pointers on the CAN ...
Boroko's user avatar
  • 1
0 votes
2 answers
89 views

How to detect If a digital pin is blinking (from high to low) in C?

I am writing a firmware application. I must read a GPIO pin connected to a smart battery, which communicates the state of the battery. A high value in the pin means the battery is in an unknow state, ...
cercio's user avatar
  • 77
0 votes
0 answers
299 views

Powering an Esp32 Project with USB-C and a Lithium Ion Battery

I have the Aitrip Esp32 Lite (see attached pinout image below). Here's what I am wondering - the devboard has an on board charging receptacle (JST) for a lithium ion battery. Using the devboard's on-...
zebetz's user avatar
  • 27
0 votes
1 answer
95 views

Issue with Pybamm Tutorial

I am going through the PYbamm tutorial of setting parametres from the official site. parameter_values["Current function [A]"] = 10 parameter_values["Open-circuit voltage at 100% SOC [V]&...
VikramVaidyanathan Triple V Ve's user avatar
0 votes
0 answers
34 views

Firemonkey Android App for GPS location crashes shortly after location update

I have an Android app written in Firemonkey (Delphi 11.1) that requires the GPS accuracy to be logged as well. I managed to get the GPS information from Android using the AndroidAPI.JNI ...
Andre Coetzer's user avatar
0 votes
0 answers
36 views

Battery Storage modelling for a data centre

I am trying to build an optimisation model (minimise costs) to procure electricity on an hourly basis to a data centre using wind,solar,grid and battery storage with an objective to achieve a certain ...
Charles's user avatar
0 votes
0 answers
19 views

Broadcast receiver in Android Studio

How to solve this on Android Studio in Java Language? You have to make two applications that: The First app is broadcast receiver The second app is twit broadcast app And you should show us: broadcast ...
Reem Abdl's user avatar
1 vote
1 answer
90 views

How to more accurately calculate a LiFePO4 12.8V battery percentage?

Grafana Data static const uint8_t lifepo4[NUM_BATT_READINGS][2] = { {144, 100}, {136, 100}, {134, 99}, {133, 90}, {132, 70}, {131, 40}, {130, 30}, {129, 20}, {128, 17}, {125, 14}, {120, ...
Jdelmore's user avatar
0 votes
0 answers
50 views

How to implement pyomo constraints using logical checks of pyomo model variables?

EDIT: The block of code below is working now, I may have missed something in my IDE, but I am having issues with other similar constraints. I believe the problem is using endogenous if statements, but ...
masebee's user avatar
  • 15
0 votes
0 answers
40 views

Battery Runtime Remaining Expression in Zabbix

I'm using this expression in a trigger in Zabbix to shutdown a server when the battery runtime remaining is less than 15 minutes: last(/xxxx UPS 3000 SNMP/battery.runtime_remaining[...
Joel Delgado Garrido's user avatar
0 votes
0 answers
27 views

is there support for a home battery on google home. Enable triggers for starting devices when home battery is full

i want to develop a smart home application linking my home battery (coupled to solar panels) to Google Home. This would allow for efficient use of the solar energy by activating certain devices or ...
kdd's user avatar
  • 656
0 votes
0 answers
149 views

How to get Bluetooth earbuds (multipoint) battery levels in Android Java?

I am having trouble figuring out how to get the battery level of the earbuds independently. I currently have a receiver that triggers when the connected bluetooth device battery level changes or the ...
Element21302's user avatar
1 vote
1 answer
67 views

Read "time to fully charged"

I am testing several laptops with Windows installed and I need to write code that takes the time (in seconds or minutes) "until fully charged" - the value that windows shows, as well as the ...
Boris Tashev's user avatar
0 votes
0 answers
258 views

Disable video play button on iPhone devices on battery-saving mode

I'm trying to disable the video play button on iPhone devices when on low battery or in battery-saving mode. I'd also like to autoplay the video even if on low battery. This is what it looks like on ...
Edo Raba's user avatar
0 votes
0 answers
28 views

I want to get battery stats of usage of every hour of 24 hour. how can it get it?

I have implemented workmanager , alarm manager and job scheduler also to get the battery level after every hour. but most of the android mobiles devices restrict the all of them to work continuesly . ...
Waqas Yousaf's user avatar
0 votes
0 answers
388 views

Battery energy storage dispatch optimization problem using pyomo and gurobi solver: error "the problem is unbounded" and the battery SOC is always 0

The following code is an optimization problem with pyomo using gurobi as solver. The objective function has the goal to maximize profits and minimize battery replacement costs: The revenue is the ...
AGr's user avatar
  • 1
-1 votes
1 answer
153 views

How to Get current charge percentage in decimal in java for android [duplicate]

I need to get the current charge percentage in decimal values like -> 50.3,20.4,etc... Is there any way to do the same in android with Kotlin/Java. Anyone Please help me with this. Algorithm / Code ...
Krithick's user avatar
0 votes
0 answers
49 views

Why does my app stop my battery charging?

I am developing an Android app and it needs to be able to run on a phone for a long time so will likely be plugged into a power source and need to charge whilst running. Using a USB current meter I ...
Jeremy Birch's user avatar
0 votes
1 answer
39 views

Removing the batteries from the remote kills the app

If the remote control uses bluetooth control, then if the battery is removed / inserted into the remote control, the following events occur: onPause() -> onSaveInstanceState() -> onCreate() ->...
Dmitriy's user avatar
  • 385
0 votes
0 answers
28 views

If I write a KMDF filter driver for laptop battery , will all PWA APPs that retrieve battery information be affected

Background: our PWA APP (JS APP) registers power change event . But for our testers , we have to manually discharge & recharge the battery to test those features , it's wasting our time. ...
H Marcus's user avatar
1 vote
0 answers
93 views

How to get BATTERY_PROPERTY_CHARGE_COUNTER on api 21 Android

Why does getIntProperty return zero on the api device 21 val batteryManager = context.getSystemService(Context.BATTERY_SERVICE) as BatteryManager val BatteryCapacity = batteryManager.getIntProperty(...
Arman's user avatar
  • 25
0 votes
0 answers
25 views

Which case saves battery in a ticket scanner app?

I'm developing a qr ticket scanner app to check in thousand+ tickets each device and i wonder if it saves battery to just let a camera fragment run in background, with a little check-in overlay ...
n0script22's user avatar
1 vote
1 answer
193 views

Sample code from bq769x0 arduino library does not compile

I try to use arduino library from github: https://github.com/LibreSolar/bq769x0-arduino-library/blob/master/bq769x0.h but it doesn't even compile. Error is connected with : #if BQ769X0_DEBUG void ...
Wiktor Łuczak's user avatar
0 votes
0 answers
73 views

Does StartMonitoringSignificantLocationChanges works in Low Power Mode

I want to add StartmonitoringSignificantLocationChanges in my app, but does it work in low power mode? Apple's documentation says that the background activity will turn off, does this apply to ...
Empiric10's user avatar
0 votes
0 answers
121 views

How to set battery threshold using tlp

I can't figure out how to set up tlp battery threshold, I don't understand their website instructions. Tlp says my laptop supports battery threshold, If anyone can guide me how to set it up thanks. ...
XENO VERSE's user avatar
3 votes
1 answer
942 views

How to create a Battery Badge that shows current Battery Level in SwiftUI

What I want to do is almost identical to the badge on MacOS and iOS devices I tried to use SFSymbols for this but it only supports %0, %25, %50, %75 and %100 but I want to update my battery badge to ...
user avatar
-1 votes
1 answer
34 views

how to drawText transparent with background Path in Canvas Drawable?

how to drawText transparent with background Path in Canvas Drawable? https://i.stack.imgur.com/RkS41.jpg
user20269297's user avatar
-1 votes
1 answer
134 views

Read battery consumption in linux

I would like to monitor my system current Watt usage. The tricky part is that I have 2 batteries (BAT0 and BAT1). I know that I can read the current power of BAT1 from this file: sys/class/...
GooDinosaur's user avatar
4 votes
0 answers
303 views

Measure battery usage for iOS from Xcode 14

There is a Energy Profile in Xcode 12. But can't see this any more in Xcode 14. And even more, it's always showing Insufficient Metrics Data for our 5k users app in Xcode organizer. I'm wondering what ...
Bagusflyer's user avatar
  • 12.7k
3 votes
0 answers
174 views

What should I use instead of navigator.getBattery()

I am looking for a navigator.getBattery() alternative. What I want to achieve is, that when you have under 30% of battery and you're not charging, it tells you to go charge. Right now I have this: ...
thisistemporary's user avatar
0 votes
1 answer
578 views

Uncaught TypeError: navigator.getBattery is not a function

I'm developping a website which is meant to be used on mobile devices using Google Chrome, the purpose is to list information such as time (hh:mm) and battery level. I saw the Battery Web API but I'm ...
AlexandreLemoine's user avatar
-1 votes
1 answer
164 views

Is it possible to get value for current battery level via ADB shell command?

With the below adb command I am able to get current battery level(as shown in image. adb shell dumpsys battery | findstr /r /c:level I am getting response as level: 12 Is there any way to get only ...
Shoaib Akhtar's user avatar
0 votes
1 answer
2k views

Is it possible to fetch current battery level via ADB shell command?

Suppose If change the battery level to any desired value(say from current 50 to 20) adb shell dumpsys battery set level 20 Now I want adb command to fetch the current battery level(ie 20). With the ...
Shoaib Akhtar's user avatar
0 votes
0 answers
63 views

My C and C++ code is taking a long time to execute ... Any tips? [duplicate]

I am running a lot of C++ and C code in VSCode, and I have noticed that while my compilation is relatively fast (g++ test.cpp), when I execute the code (./a.exe) there is about a 3 second gap between ...
cjmess01's user avatar
0 votes
1 answer
50 views

How to measure Battery Drainage Ratio?

I were using some of foreground service continuously in background and also was tracking location in background. Now I have reduced it depending on some of time frame logic, but I want to know how ...
Rujul Gandhi's user avatar
  • 1,350
1 vote
1 answer
76 views

VB.NET : Battery percentage code isn't updated in real-time

I made a program with Visual Studio to display battery percentage using a Label and ProgressBar, the problem I had is that the battery percentage isn't updated in real time although I already put ...
Fabieen Rae's user avatar
1 vote
1 answer
82 views

Information about the time remaining won't appear. Why?

The HTML5 Battery Status API (Remake, code shown below) has a problem. The time left (until the battery runs out) is not showing up. I tried copying the JavaScript from the original project on CodePen....
Christian Samu's user avatar
0 votes
1 answer
365 views

Battery management using MATLAB Simulink and Stateflow

I am designing a battery model and its control to undergo cyclic charge and discharge. The battery model is created by using a simscape electrical battery block (Table-based). The control is modeled ...
Joshni's user avatar
  • 3
4 votes
0 answers
170 views

Battery optimization not available on WearOS

I'm developing a tracking application that runs on Wear OS watches. I have some troubles when the watch goes to sleep. As soon as the watch goes to Deep Idle mode, all sensors acquisition stops. For ...
Loïc Zimmermann's user avatar
0 votes
1 answer
538 views

How to completely prevent Android Lock Screen

I made an field guide app for biology. It does tons of stuff, for example, recordings of wildlife sounds, and it is made to run the whole day with a single battery charge. Since it is intended to be ...
Luis A. Florit's user avatar
0 votes
1 answer
303 views

How to accurately estimate the time remaining in a PC/Laptop battery?

I am making a C++ program on Windows in Visual Studio 2017. I want this program to calculate how long the battery will last on the laptop/PC the program is running on. I want to make this program ...
coolbean4's user avatar
0 votes
1 answer
413 views

Turn off App-Info Battery Optimization from Kotlin

I am running an app which needs to run a service in the background using IMU (accelerometer and gyroscope data) in the background, while the app is in background and the screen is off. After sometime, ...
Sanskar Biswal's user avatar
0 votes
1 answer
106 views

How hard is it to control laptop's battery charge or to limit? [closed]

I wonder if it is possible to write a program which would limit the battery charge of a laptop. I know some manufacturers like Asus, Lenovo etc. have such build-in software, but I am curious if anyone ...
Svetoslav Stoyanov's user avatar
0 votes
1 answer
1k views

How to persistently get Battery level and Charging status in Android (Kotlin)?

I want to get the battery level and charging status(plugged or unplugged) persistently for my app, i.e every 3-4 seconds, or better, only when it changes. Currently I am doing this:         val bm = ...
coderGtm's user avatar
0 votes
2 answers
245 views

What is the correct way to set a standby interval for an Android App?

I'm maintaining an app that is used by several companies, each of them with their own devices. One of them bought new tablets (Samsung A8 LTE with Android 11) and they started to have some problems. ...
Antonio P.'s user avatar
1 vote
0 answers
199 views

Android. Show notification in exact time

I have a question, that has been asked here many times, but I still can't find correct solution. I need to implement in an app a feature, that will show notification in exact time (for example, show ...
Lim's user avatar
  • 11
2 votes
2 answers
2k views

navigator.getBattery cannot be found

I made a program that would list the battery level and charging into a div. My code is below. For some reason, when I run it, it tells me that navigator.getBattery is not a function. How can I fix ...
lolBOT V9.17's user avatar

1
2 3 4 5
18