The location awareness feature can significantly drain the device’s battery.
The recommended way to maximize the battery life is to use the fused location provider which combines signals from GPS, Wi-Fi, and cell
networks, as well as accelerometer, gyroscope, magnetometer and other sensors. The FusedLocationProviderClient
automatically chooses the
best method to retrieve a device’s location based on the device’s context.
The rule flags an issue when android.location.LocationManager
or com.google.android.gms.location.LocationClient
is used
instead of com.google.android.gms.location.FusedLocationProviderClient
.
What is the potential impact?
- Usability: the non-optimized location API consumer more battery.
- Sustainability: the extra energy required has a negative impact on the environment.