Acquiring Battery Information - Epson Moverio Pro BT-2000 Developer's Manual

Hide thumbs Also See for Moverio Pro BT-2000:
Table of Contents

Advertisement

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 =
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 Developer's Guide (Rev.1.4)
new
IntentFilter();
180

Advertisement

Table of Contents
loading

This manual is also suitable for:

Moverio pro bt-2200

Table of Contents