How to get information about android battery usage by application

The project isn’t complete by any stretch of the imagination, but I created an application framework (kinda…that was the goal, it’s not there yet) to do just this. Check out http://syspower.googlecode.com. You won’t be able to get the percentage by application unless you calculate the usage for all applications but you can get quantitative values … Read more

How to start Power Manager of all android manufactures to enable background and push notification?

i have collected some intent from various post: private static final Intent[] POWERMANAGER_INTENTS = { new Intent().setComponent(new ComponentName(“com.miui.securitycenter”, “com.miui.permcenter.autostart.AutoStartManagementActivity”)), new Intent().setComponent(new ComponentName(“com.letv.android.letvsafe”, “com.letv.android.letvsafe.AutobootManageActivity”)), new Intent().setComponent(new ComponentName(“com.huawei.systemmanager”, “com.huawei.systemmanager.startupmgr.ui.StartupNormalAppListActivity”)), new Intent().setComponent(new ComponentName(“com.huawei.systemmanager”, “com.huawei.systemmanager.optimize.process.ProtectActivity”)), new Intent().setComponent(new ComponentName(“com.huawei.systemmanager”, “com.huawei.systemmanager.appcontrol.activity.StartupAppControlActivity”)), new Intent().setComponent(new ComponentName(“com.coloros.safecenter”, “com.coloros.safecenter.permission.startup.StartupAppListActivity”)), new Intent().setComponent(new ComponentName(“com.coloros.safecenter”, “com.coloros.safecenter.startupapp.StartupAppListActivity”)), new Intent().setComponent(new ComponentName(“com.oppo.safe”, “com.oppo.safe.permission.startup.StartupAppListActivity”)), new Intent().setComponent(new ComponentName(“com.iqoo.secure”, “com.iqoo.secure.ui.phoneoptimize.AddWhiteListActivity”)), new Intent().setComponent(new ComponentName(“com.iqoo.secure”, “com.iqoo.secure.ui.phoneoptimize.BgStartUpManager”)), … Read more

Android Battery in SDK

Here is a quick example that will get you the amount of battery used, the battery voltage, and its temperature. Paste the following code into an activity: @Override public void onCreate() { BroadcastReceiver batteryReceiver = new BroadcastReceiver() { int scale = -1; int level = -1; int voltage = -1; int temp = -1; @Override … Read more