Showing a map of the user’s location
Having successfully obtained permission from the user to access their location, we can now access the last known location of the device. This location is also usually the user’s current location. We can use this information to present the user with a map of their current location.
To obtain the user’s last known location, Google provides the Google Play location service and, more specifically, the FusedLocationProviderClient class. The FusedLocationProviderClient class helps us interact with Google’s Fused Location Provider API, which is a location API that intelligently combines different signals from multiple device sensors to provide us with device location information.
To access the FusedLocationProviderClient class, we must first include the Google Play location service library in our project. This simply means adding the following dependency to our app, using the latest version available:
play-services...