240 likes | 263 Views
This PDF will explain you, how you can reduce the battery consumption during using the Android app. It helps you to understand the process step by step.
E N D
Battery Optimization: Android Apps With Best Practices for Zero Compromise on Performance
JOB Scheduler API ✓ ✓ ✓ ✓ ✓ ✓
Android Doze ✓ ✓ ✓
Android Doze Extended ✓ ✓ ✓
Code Snippet to determine Charging State and Method // Are we charging / charged? int status = batteryStatus.getIntExtra(BatteryManager.EXTRA_STATUS, -1); boolean isCharging = status == BatteryManager.BATTERY_STATUS_CHARGING || status == BatteryManager.BATTERY_STATUS_FULL; // How are we charging? int chargePlug = batteryStatus.getIntExtra(BatteryManager.EXTRA_PLUGGED, -1); boolean usbCharge = chargePlug == BatteryManager.BATTERY_PLUGGED_USB; boolean acCharge = chargePlug == BatteryManager.BATTERY_PLUGGED_AC;
Monitor Connectivity State to Limit Battery Drain ✓ ✓ ✓
Monitor Connectivity State to Limit Battery Drain ConnectivityManager cm = (ConnectivityManager)context.getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo activeNetwork = cm.getActiveNetworkInfo(); boolean isConnected = activeNetwork != null && activeNetwork.isConnectedOrConnecting();
Key Steps required to Minimize Server Updates and Optimize the Battery Drain
Key Steps to Minimize Server Updates and Optimize the Battery Drain
Key Steps required to Minimize Server Updates and Optimize the Battery Drain
Key Steps to Minimize Server Updates and Optimize the Battery Drain
Key Steps to Minimize Server Updates and Optimize the Battery Drain