2

I am using fused location Google api client to get location,as I am having update device so it is working fine, there may be scenario like customer may not having updated google play services. so what minimum google play services version is required for Fused location(Google API Client), and how to check or validate that programmatically.

Vadim Kotov
  • 7,103
  • 8
  • 44
  • 57
Siddharth
  • 56
  • 3
  • please visit https://stackoverflow.com/a/34943703/4853552 for the "how to check " – Shubham Jain Oct 05 '17 at 12:54
  • what minimum google play services version is required for Fused location(Google API Client). api.isGooglePlayServicesAvailable(activity); – Siddharth Oct 05 '17 at 12:58
  • A complete example of handling Google API Client, [AbstractGoogleApiClientActivity](https://github.com/commonsguy/cw-omnibus/blob/master/Location/FusedNew/app/src/main/java/com/commonsware/android/weather2/AbstractGoogleApiClientActivity.java) – blackkara Oct 06 '17 at 07:34

1 Answers1

2

I don't think any minimum version is mentioned in the Android Documents https://developer.android.com/training/location/retrieve-current.html

But if you want to handle Errors while connecting to the GoogleApiClient you should implement GoogleApiClient.OnConnectionFailedListener https://developers.google.com/android/reference/com/google/android/gms/common/api/GoogleApiClient.OnConnectionFailedListener

And call this code by passing error result code and implement onActivityResult to handle the result:

GooglePlayServicesUtil.showErrorDialogFragment(resultCode,this,CONNECTION_FAILURE_RESOLUTION_REQUEST); 

Note: I haven't implemented it, but that is how it is done.

Vadim Kotov
  • 7,103
  • 8
  • 44
  • 57
Seeker
  • 530
  • 4
  • 8