Android examples for android.os:Battery
get Battery Status
import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.os.BatteryManager; public class Main{ private static Intent getBatteryStatus(Context context) { IntentFilter filter = new IntentFilter( Intent.ACTION_BATTERY_CHANGED); return context.registerReceiver(null, filter); }//from w w w . j a v a 2 s .co m }