On my nexus one, there is a handy app reachable from Settings > About Phone > Battery use.
I'd like to StartActivity() that app from one of my Activities.
I can see in the log that when Settings runs it, this intent is logged:
Starting activity:
Intent { act=android.intent.action.MAIN
cmp=com.android.settings/.fuelgauge.PowerUsageSummary }
I'm having trouble relating that to something in Android Java source. I can't even find "fuelgauge" in the GIT source. Can anyone point me to the right file, or anything else helpful, like how to create the right kind of Intent?
Thanks
Peter
Batterystats is a tool included in the Android framework that collects battery data on your device. You can use adb to dump the collected battery data to your development machine and create a report you can analyze using Battery Historian.
setType(String mimeType) input param is represent the MIME type data that u want to get in return from firing intent(here myIntent instance). by using one of following MIME type you can force user to pick option which you desire. Please take a Note here, All MIME types in android are in lowercase.
Apps like Waze™ and Google Maps™ help you get around using your phone's location services feature. But if these apps are running behind the scenes and you aren't traveling, location services can drain your battery.
Code is as follows:
Intent powerUsageIntent = new Intent(Intent.ACTION_POWER_USAGE_SUMMARY);
ResolveInfo resolveInfo = getPackageManager().resolveActivity(powerUsageIntent, 0);
// check that the Battery app exists on this device
if(resolveInfo != null){
startActivity(powerUsageIntent);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With