So there is no way to learn which "constants" are available? (except finding some codes on the Internet...) I am quite disappointed ;-)
Thanks for your answer, D. On Aug 19, 6:40 pm, Mark Murphy <[email protected]> wrote: > DaminouU wrote: > > Hi, > > > I was wondering how to use the BatteryManager's constants when I find > > this link : > > >http://twisty.googlecode.com/svn-history/r26/trunk/twisty/src/com/goo... > > > There you can find a method called "monitorBatteryState". > > In this one I saw those lines : > > int rawlevel = intent.getIntExtra("level", -1); > > int scale = intent.getIntExtra("scale", -1); > > int status = intent.getIntExtra("status", -1); > > int health = intent.getIntExtra("health", -1); > > ... > > > I am a newbie on Android so I read Intent and BroadcastReceiver to > > understand what it is and where I can find a "list" with that data > > ("level", "status", ...) but I didn't find anything. > > They are undocumented, unfortunately. On the other hand, if you simply > dump all of the extras out of one of those Intents, you will find that > most are self-explanatory, or tie into constants defined on > BatteryManager. Note that "level" is in terms of "scale" (e.g., if > "scale" is 100, "level" will be 0-100 indicating an integer percentage > of battery life remaining). > > > I think I understand that those values are "modified by the battery" > > and that my broadcastReceiver gets these changes. Is it correct? > > Correct. > > -- > Mark Murphy (a Commons > Guy)http://commonsware.com|http://twitter.com/commonsguy > > Looking for Android opportunities?http://wiki.andmob.org/hado --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

