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
3
votes
2 answers

Android BatteryManager Returns only 1

I am attempting to read the state of the Android battery when my repeating alarm broadcaster is called I have the following setup: public class RepeatingAlarm extends BroadcastReceiver { @Override public void onReceive(Context…
eWizardII
  • 1,916
  • 4
  • 32
  • 55
3
votes
3 answers

Get Battery Level with BroadcastReceiver in Android Service

I have a code, that I need get the Battery Level of my Android device, but I have a big problem. I have an Android Service where I go get battery level and send by UDP. This is my Service code: public class Servico extends Service { String bateria…
Yuri Monteiro
  • 82
  • 1
  • 1
  • 8
3
votes
3 answers

Android GPS battery usage

I am writing a program in Android that uses GPS. It will prompt the user to turn on location services if it is not on (which I guess is equivalent to turning on gps ?). My question is: does the gps immediately start consuming extra battery power as…
Cemre Mengü
  • 18,062
  • 27
  • 111
  • 169
3
votes
2 answers

Remaining time to battery discharge on android

I am looking for a code for estimating/guessing time remaining before the android phone battery is completely discharged. My search results were full of apps available and also the common comment that it's pretty much useless to calculate it.…
user1841900
  • 51
  • 1
  • 3
3
votes
0 answers

Finding battery current (mA/mAh) on Android Tablet

I'm creating an application, and I need to be able to get the battery's current (mA/mAh). I have the voltage/temp/level etc and this is the final thing I need to get, and coincidentally the hardest too. I've looked at CurrentWidget source code and…
fypfyp
  • 206
  • 4
  • 10
3
votes
1 answer

Is there a way to access the "time since last full charge" value in iOS using objective-c?

In settings, under usage, there are values for time elapsed since last full charge. Is there a way to access these values in iOS? I have searched but I have been unable to locate anything myself. Have i overlooked a particular part of the…
3
votes
1 answer

How to measure the energy consumed by my Android app in a certain moment

I have been trying to figure this out since couple months ago because I'm working on my thesis, but unfortunately I have not been able to make it. What I'm doing is a performance analysis regarding energy consumed by an application running an…
KinGPinG
  • 171
  • 3
  • 11
3
votes
2 answers

Android location aware notifications

I'm looking for best techniques for Location Aware notifications. My first try was to use LocationManager's addProximityAlert but it requires ACCESS_FINE_LOCATION (COARSE_LOCATION gives me a SecurityException) and keeps the GPS always ON and active…
luciofm
  • 737
  • 5
  • 14
3
votes
2 answers

android-Way of detecting low battery notification

Is there a way to detect a low battery notification in android eclipse?I have an action game that needs to be paused when it appears.
user1491060
  • 31
  • 1
  • 3
2
votes
2 answers

Android - repeated fragment transactions and phone resources (complex)

Preface - The code I have created so far already delivers the desired user interface, my question is about phone resources and whether there is a 'better' implementation. Also, I am relatively new to Android development and may be misunderstanding…
HeMightBeTodd
  • 117
  • 1
  • 9
2
votes
3 answers

What are the things which reduces (Android) battery time?

In one of our application we need to use the GPS continuesly ,the purpose is to get the user driving speed. Recently I found that while using the GPS continuesly can drain the device battery. If the GPS device is not used, device battery will work…
Yaqub Ahmad
  • 27,569
  • 23
  • 102
  • 149
2
votes
1 answer

battery status on ACTION_POWER_CONNECTED

I'm just wondering if is there any possibility to obtain battery status in broadcast receiver class that fires on ACTION_POWER_CONNECTED? Documentation suggest not, but it is always worth to ask :) Cheers Ray
Ray
  • 582
  • 1
  • 7
  • 15
2
votes
1 answer

Creating a ChargeInhibit Assertion (OS X 10.6.8)

Platform (OS X 10.6.8) - [Macbook Pro - this is important as I want to deal with the battery handling - not applicable for a desktop] Forgive me if I've made a basic mistake that I don't see, as I haven't written any C/C++ in five years or more,…
Joe Mac
  • 121
  • 3
2
votes
1 answer

Can I register more than one BroadcastReceiver for an Activity in an Android Programming?

I implemented a sample application which Shows the Phone Information, Battery Information of an Android application. I created two different Class files for two activities. There is no issue in getting the phone related information. There is an…
Puru
  • 8,913
  • 26
  • 70
  • 91
2
votes
2 answers

Android webkit and battery consumption

I´ve been working on a android webkit application, which has a considerably sophisticated UI (plenty of icons, CSS, JS and HTML5 pages). However, the application drains device battery. I installed some tools to measure power consumption and it´s…
s9rlherb
  • 68
  • 1
  • 7