|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.googlecode.android_scripting.jsonrpc.RpcReceiver
com.googlecode.android_scripting.facade.BatteryManagerFacade
public class BatteryManagerFacade
Exposes Batterymanager API. Note that in order to use any of the batteryGet* functions, you need to batteryStartMonitoring, and then wait for a "battery" event. Sleeping for a second will usually work just as well.
| Field Summary | |
|---|---|
static int |
BATTERY_PLUGGED_AC
Power source is an AC charger. |
static int |
BATTERY_PLUGGED_USB
Power source is a USB port. |
| Constructor Summary | |
|---|---|
BatteryManagerFacade(FacadeManager manager)
|
|
| Method Summary | |
|---|---|
java.lang.Boolean |
batteryCheckPresent()
|
java.lang.Integer |
batteryGetHealth()
|
java.lang.Integer |
batteryGetLevel()
|
java.lang.Integer |
batteryGetPlugType()
|
java.lang.Integer |
batteryGetStatus()
|
java.lang.String |
batteryGetTechnology()
|
java.lang.Integer |
batteryGetTemperature()
|
java.lang.Integer |
batteryGetVoltage()
|
void |
batteryStartMonitoring()
throws "battery" events |
void |
batteryStopMonitoring()
|
Bundle |
readBatteryData()
|
void |
shutdown()
Invoked when the receiver is shut down. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int BATTERY_PLUGGED_AC
public static final int BATTERY_PLUGGED_USB
| Constructor Detail |
|---|
public BatteryManagerFacade(FacadeManager manager)
| Method Detail |
|---|
@Rpc(description="Returns the most recently recorded battery data.") public Bundle readBatteryData()
@Rpc(description="Starts tracking battery state.") @RpcStartEvent(value="battery") public void batteryStartMonitoring()
@Rpc(description="Stops tracking battery state.") @RpcStopEvent(value="battery") public void batteryStopMonitoring()
public void shutdown()
RpcReceiver
shutdown in class RpcReceiver@Rpc(description="Returns the most recently received battery status data:\n1 - unknown;\n2 - charging;\n3 - discharging;\n4 - not charging;\n5 - full;") public java.lang.Integer batteryGetStatus()
@Rpc(description="Returns the most recently received battery health data:\n1 - unknown;\n2 - good;\n3 - overheat;\n4 - dead;\n5 - over voltage;\n6 - unspecified failure;") public java.lang.Integer batteryGetHealth()
@Rpc(description="Returns the most recently received plug type data:\n-1 - unknown\n0 - unplugged;\n1 - power source is an AC charger\n2 - power source is a USB port") public java.lang.Integer batteryGetPlugType()
@Rpc(description="Returns the most recently received battery presence data.") @RpcMinSdk(value=5) public java.lang.Boolean batteryCheckPresent()
@Rpc(description="Returns the most recently received battery level (percentage).") @RpcMinSdk(value=5) public java.lang.Integer batteryGetLevel()
@Rpc(description="Returns the most recently received battery voltage.") @RpcMinSdk(value=5) public java.lang.Integer batteryGetVoltage()
@Rpc(description="Returns the most recently received battery temperature.") @RpcMinSdk(value=5) public java.lang.Integer batteryGetTemperature()
@Rpc(description="Returns the most recently received battery technology data.") @RpcMinSdk(value=5) public java.lang.String batteryGetTechnology()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||