It's been a while since I worked with Google Play Services and I'm now implementing a feature that requires location tracking. After following a dated example that used GoogleApiClient
, I found this post about the new Location APIs at Android Developers blog:
https://android-developers.googleblog.com/2017/06/reduce-friction-with-new-location-apis.html
FusedLocationProviderClient client =
LocationServices.getFusedLocationProviderClient(this);
client.requestLocationUpdates(LocationRequest.create(), pendingIntent)
.addOnCompleteListener(new OnCompleteListener() {
@Override
public void onComplete(@NonNull Task task) {
Log.d("MainActivity", "Result: " + task.getResult());
}
});
}
What caught my attention was something written at the bottom of the post, saying:
The new API will automatically resolve certain connection failures for you, so you don't need to write code that for things like prompting the user to update Google Play services.
Since I've already written that piece of code using GoogleApiAvailabilty
I'm curious if it's safe to just remove it and let the FusedLocationProviderClient
take care of it?
I've tried to find another source to verify this but failed, not really satisfied with half a line at the bottom of a blog post, hence posting the question here.