Go Back   Android Forums > Android Development > Application Development
Application Development Dev Lounge for the Coder Folks
Gamers - Check out our new sister sites!
Nintendo Wii U!    |    OUYA - $99 Android System!

test: Reply
 
LinkBack Thread Tools
Old June 18th, 2012, 12:21 PM   #1 (permalink)
New Member
Thread Author (OP)
 
Join Date: Jun 2012
Posts: 1
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Unhappy BatteryManager

Hi,

I'm writing an application for the original galaxy tab that is running 2.3.6. One of the features of the application is to return battery data from the BatteryManager. I used the development tutorials, resources and references from the android development website. I'm have problems when determining when the tab is charging. I use this code:

int status = intent.getIntExtra(BatteryManager.EXTRA_STATUS, -1);
boolean isCharging = status == BatteryManager.BATTERY_STATUS_CHARGING || status == BatteryManager.BATTERY_STATUS_FULL;

The problem is that the status variable always has a value of 4, which is public static final int BATTERY_STATUS_NOT_CHARGING
Since: API Level 1
Constant Value: 4 (0x00000004)

so no matter how the tab is plugged in, by ac or usb, or not plugged in, status = 4. Is this a firmware thing? Or a tab thing? Any ideas?

patherrod is offline  
Reply With Quote
Sponsors
Reply
Tags
.extra_status, battery, battery manager, batterymanager, galaxy tab, tab


Go Back   Android Forums > Android Development > Application Development
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 05:01 PM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.