- Principles of building battery-conscious apps
- Causes of excessive battery drain
- Correct usage of Alarm Manager, services, broadcast receivers, and threads
- Working with the Android JobScheduler API
- Monitoring and acting on battery state changes
- Handling Android Marshmallow Doze mode
- Diagnosing battery issues with the Battery Historian tool
Skill Level Intermediate
- [Ravi] If you've ever found yourself frantically searching for a charger with your battery at 8%, you know the pain that many Smartphone users encounter. Users care about the battery life of their devices. Smartphones are everywhere and used by everyone for a wide variety of things, running apps, playing games, taking photos, making phone calls, and sending text messages. All of this takes a good amount of battery power. The more apps you run, the more battery power you use.
Poorly written apps use up far more battery power than they need and make the user experience worse across the entire device. A misbehaving app may encourage self-defeating user behavior. If a user switches their phone into a lower power or Airplane Mode, just to prevent battery drain, their online apps aren't really online anymore. Modern versions of Android now show users how much power each app is consuming. So offending apps get poorer Play Store reviews, or worse, they get uninstalled.
It's vital to build apps that are good citizens, only using the power that they need, which brings us to the main idea of this course. Android provides many APIs and tools that can help us address these issues. So, let's take a look at how we can use them to build battery conscious apps.