问题
I am developing an application and using Mobile Vision Api for text recognizing.I noticed that its not working in some devices.After searched I understand that one reason is because of google play service version that is installed on device.So how can I check the google play service version that is installed on user device? And what is the minimum google play service version that this api could work?
回答1:
You can use this for checking version
GoogleApiAvailability.GOOGLE_PLAY_SERVICES_VERSION_CODE
I think, first you should check, if service is available ?
public int isGooglePlayServicesAvailable (Context context)
Google Doc
回答2:
How to know GPS version of your phone?
If manually, go to Settings > Applications > Google Play Services.
If programatically, follow the answer in this SO thread:
int v = getPackageManager().getPackageInfo("com.google.android.gms", 0 ).versionCode;
What is the minimum google play service version for this API?
Minimum Android version required is Android 2.3 (Gingerbread).
来源:https://stackoverflow.com/questions/43187956/android-how-to-check-google-play-service-version-for-mobile-vision-api