MOVERIO Pro Developer's Guide (Rev.1.4)
180
9.2.
Acquiring Battery Information
Use the Filter intent broadcast by the operating system, and acquire the battery information.
Usage examples are displayed below.
■ Register the receiver of the battery information broadcast by the app
IntentFilter filter =
new
IntentFilter();
filter.addAction(Intent.
ACTION_BATTERY_CHANGED
);
registerReceiver(
mBroadcastReceiver
, filter);
■ Acquire broadcast battery information
Example: Acquiring the amount of power remaining, status, and installation status for battery A
@Override
public
void
onReceive(Context context, Intent intent){
int
level_a = intent.getIntExtra(
BatteryManager.EXTRA_LEVEL_A
, 0);
String status_a = intent.getStringExtra(
BatteryManager.EXTRA_STATUS_A
);
boolean
present_a = intent.getBooleanExtra(
BatteryManager.EXTRA_PRESENT_A
,
false
);
Содержание Moverio Pro BT-2000
Страница 7: ...MOVERIO Pro Developer s Guide Rev 1 4 1 1 Introduction ...
Страница 12: ...MOVERIO Pro Developer s Guide Rev 1 4 6 2 Developing Apps ...
Страница 30: ...MOVERIO Pro Developer s Guide Rev 1 4 24 3 Display control ...
Страница 39: ...MOVERIO Pro Developer s Guide Rev 1 4 33 4 UI control ...
Страница 47: ...MOVERIO Pro Developer s Guide Rev 1 4 41 5 Voice commands ...
Страница 70: ...MOVERIO Pro Developer s Guide Rev 1 4 64 6 Camera control ...
Страница 119: ...MOVERIO Pro Developer s Guide Rev 1 4 113 7 Sensor control ...
Страница 127: ...MOVERIO Pro Developer s Guide Rev 1 4 121 8 Bluetooth BLE ...
Страница 184: ...MOVERIO Pro Developer s Guide Rev 1 4 178 9 Power control ...
Страница 187: ...MOVERIO Pro Developer s Guide Rev 1 4 181 10 Self diagnostic function ...
Страница 191: ...MOVERIO Pro Developer s Guide Rev 1 4 185 11 GPS Assist ...
Страница 202: ...MOVERIO Pro Developer s Guide Rev 1 4 196 Memo ...