You can get battery life using the broadcast receiver by registering the receiver for the Intent.ACTION_BATTERY_CHANGED action . My answer is only key, get information from the Android developers website.
onReceive() BroadcastReceiver Intent, (, 50%, 60% ..). , . , .
battery_level = intent.getIntExtra(BatteryManager.EXTRA_LEVEL, -1);
, .