[android-developers] Re: Battery Status and Signal Strength Acheivement

2009-09-17 Thread Alex Tang
I test my app in HTC GPhone Dream. SystemProperties.get(status.battery.level_raw) will return null. So I use a receiver to receive Intent.ACTION_BATTERY_CHANGED and good news is each time when my app starts, the receiver will receive the intent instantly. So we can get battery level at the

[android-developers] Re: Battery Status and Signal Strength Acheivement

2009-09-11 Thread Android Development
You can use: http://developer.android.com/reference/android/telephony/PhoneStateListener.htmlhttp://developer.android.com/reference/android/telephony/PhoneStateListener.htmlto listen to the signal strength changes, just like the Android notification bar does. On Fri, Sep 11, 2009 at 9:16 PM,

[android-developers] Re: Battery Status and Signal Strength Acheivement

2009-09-11 Thread Alex Tang
So it only gives asu, not dBm? I find there are two functions: onSignalStrengthChange(int asu) and onSignalStrengthsChange(SignalStatus signalStatus) (maybe the parameter is incorrect), can the latter one be used now? On Sep 11, 11:54 pm, Android Development indodr...@gmail.com wrote: You can

[android-developers] Re: Battery Status and Signal Strength Acheivement

2009-09-11 Thread Alex Tang
Attention: SystemProperties.get(status.battery.level_raw) can get battery status instantly! Like typing #getprop status.battery.level_raw in adb shell On Sep 11, 11:46 pm, Alex Tang tangli1987...@gmail.com wrote: First I want to acheive battery status and signal strength instantly. For

[android-developers] Re: Battery Status and Signal Strength Acheivement

2009-09-11 Thread Mark Murphy
Alex Tang wrote: SystemProperties.get(status.battery.level_raw) can get battery status instantly! Like typing #getprop status.battery.level_raw in adb shell This is not part of the SDK. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Android Training

[android-developers] Re: Battery Status and Signal Strength Acheivement

2009-09-11 Thread Dianne Hackborn
On Fri, Sep 11, 2009 at 9:10 AM, Alex Tang tangli1987...@gmail.com wrote: SystemProperties.get(status.battery.level_raw) can get battery status instantly! Like typing #getprop status.battery.level_raw in adb shell Don't do that. It is not part of the SDK, and your app will break. --

[android-developers] Re: Battery Status and Signal Strength Acheivement

2009-09-11 Thread Alex Tang
Emulator can run, i will try it in real device. On Sep 12, 12:53 am, Dianne Hackborn hack...@android.com wrote: On Fri, Sep 11, 2009 at 9:10 AM, Alex Tang tangli1987...@gmail.com wrote: SystemProperties.get(status.battery.level_raw) can get battery status instantly! Like typing #getprop