Android : How to check google play service version for mobile vision api

女生的网名这么多〃 提交于 2020-01-17 09:09:31

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!