Questions tagged [battery]

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

An electric battery is a device consisting of one or more electrochemical cells that convert stored chemical energy into electrical energy.

Each cell contains a positive terminal, or cathode, and a negative terminal, or anode. Electrolytes allow ions to move between the electrodes and terminals, which allows current to flow out of the battery to perform work.

871 questions
6
votes
2 answers

How to handle iPhone 'Low Battery' pop up during a game

I was wondering how low battery alerts can be handled during a game. I used Cocos2D to make my game. I have the game pause when an interrupt such as a text or a call come in. But what about low battery alerts? Are they the same as other interrupts?…
AbhinavVinay
  • 303
  • 6
  • 18
5
votes
1 answer

Android 2.0 Best Method to Check Battery Level/Charging?

Okay let me start off by saying I have been looking around a lot for an answer to this question. I am trying to figure out what is best practice and what best for battery life. Here is my situation: I would like my application to suspend its…
Havoc
  • 213
  • 4
  • 11
5
votes
2 answers

Is location provider really a battery drain?

I need to implement location-based service. I don't need fine location, so no GPS is needed. Easiest would be to start listening for locations updates at app start, and leave it ON: …
gpo
  • 3,388
  • 3
  • 31
  • 53
5
votes
1 answer

What are the most battery-consuming things you can do in an iPhone-app?

I am making an app that quickly drains the users battery. For this, I am planning on using the sound-framework for vibrating, location services, download large but empty files from the internet, use the flashlight on the back of the phone, and so…
Emil
  • 7,220
  • 17
  • 76
  • 135
5
votes
2 answers

Android disable display off while charging

In my application I need to disable display power off when device is charging. There is an option in Developer Menu to disable it, so I can to send Intent for user to enable it. Also I've found info about PowerManager and WakeLocks, but it is for…
skayred
  • 10,603
  • 10
  • 52
  • 94
5
votes
4 answers

Preserving battery life when using Xcode - your settings/recommendations?

I often find myself wanting to open Xcode and do a little coding on international flights and while I'm away from power, but it's a quick way to empty my MacBook Pro's battery. What settings do you use to preserve battery life while running Xcode?
Tony Arnold
  • 2,738
  • 1
  • 23
  • 34
5
votes
3 answers

Script to play a warning when battery level is under a threshold in MacOS

I am using a MacBook and the battery is unreliable. I am trying to find a script command that will enable the laptop to play a beep when the battery level is lower than a threshold. After some search and tests, I found a quick solution below: 1) I…
Mike
  • 51
  • 1
  • 3
5
votes
0 answers

Getting around Meizu App Auto-Clean

I am having a problem where a Meizu phone is killing my Application, because of what seems to be a Meizu specific setting, where apps are killed after running and consuming power in the background for 3 minutes, after standby. Certain apps on the…
slayerpjo
  • 173
  • 1
  • 11
5
votes
1 answer

How to measure power consumption of my application on Android?

I have developed an Android application and I would like to know the power consumption of my app on an Android device. I came across various threads on Stack Overflow but none of them helped me. Is there any application in Android which measures the…
John
  • 565
  • 8
  • 23
5
votes
3 answers

How to calculate remaining time of android phone battery?

I am developing battery health app on Android Studio. I want to know how to calculate remaining time by playing music or video, browsing website, or standby. I have seen many android apps like this but can not see the source code. I want to see the…
bluesky
  • 61
  • 1
  • 5
5
votes
1 answer

Fetch the battery status of my MacBook with Swift

I want to setup a Playground to fetch the battery status of my macbook. I have already tried the following: import Cocoa import IOKit import Foundation var blob = IOPSCopyPowerSourcesInfo() I am currently receiving an error as below Use of…
5
votes
6 answers

How do you manage battery health of your development devices when is always plugged in?

I know this question is not programming related, so for this I made community wiki. Developers are the best guys to answer the question. I am addressed to those that do development on devices that runs on batteries, like phones, gadgets etc.…
Pentium10
  • 204,586
  • 122
  • 423
  • 502
5
votes
1 answer

Does the accelerometer drain battery on Android Wear? (Android watch)

I'm creating an Android Wear app that tries to detect some of the hand movements, to do it, I need to continuously monitor the accelerometer output. I'm wondering how it will affect the battery life. For phones, I know that there are methods like…
Umair
  • 1,206
  • 1
  • 13
  • 28
5
votes
1 answer

Does OpenGL ES drain more battery than standard 2D graphics?

I'm contemplating writing an app which does a lot of moving 2D graphics. I'm not very familiar with the standard android 2D graphics API, and I'm a lot more comfortable with OpenGL so I'm naturally considering using OpenGL instead. My consideration…
falstro
  • 34,597
  • 9
  • 72
  • 86
5
votes
2 answers

Android - Drain battery quickly on purpose

I am nearly finished with my app and last functionality to be made is to call specific action when battery level reaches below specific level. So for test purposes I am wondering - how can I drain battery? P.S - Using AVD wont work since my app is…
arleitiss
  • 1,304
  • 1
  • 14
  • 38