The Google Play Services library allows for integrating device information into code. Much of this functionality requires permission requests – like requests for access to location tracking (via GPS or Wi-Fi scans). LocationRequest
objects allow for adjusting the frequency and precision of these requests (parameters found here).
The FusedLocationProviderClient
class allows access to device location information and related methods. The getLastLocation()
method in particular fetches a cached location from the device (compared to getCurrentLocation()
, which makes a new check for the device location). This method can return null in multiple cases (user settings changes can wipe the last cached location).