问题描述
谷歌播放是一个Android库,其目标是提供服务:
Google Play services is an Android library whose goal is to provide:
- 的OAuth 2.0认证
- Google+登录功能
- Google+的+1按钮
- 在其他各种好吃的东西
如果我决定使用它(比如,因为我希望Google+登录功能),那么我不知道会发生在用户的设备不具备谷歌播放(角落,的CyanogenMod,中国移动,旧设备等)的内容。
If I decide to use it (for instance because I want Google+ sign-in), then I wonder what will happen to users whose device does not have Google Play (Nook, Cyanogenmod, China Mobile, old devices, etc).
我想申请将不能够使用图书馆在这些设备上。
问:此外,将应用程序变得不符合这样的设备
?有没有使用谷歌播放服务时,记住这一点最好的做法?
I guess the application will not be able to use the library on such devices.
QUESTION: Furthermore, will the application become incompatible with such devices?
Is there a best practice to keep this in mind when using Google Play services?
推荐答案
如果从谷歌的功能播放服务是必不可少的,你的应用程序就没有办法让你的应用程序的工作。
If the feature from Google Play Services is essential for your app there would be no way to get your App working.
您可以检查服务从启用你的应用程序中使用<$c$c>GooglePlayServicesUtil.isGooglePlayServicesAvailable(android.content.Context)$c$c>
返回 ConnectionResult.SUCCESS
如果播放服务是可用的。
You can check if the services are enabled from within your app with GooglePlayServicesUtil.isGooglePlayServicesAvailable(android.content.Context)
which returns ConnectionResult.SUCCESS
if Play Services is available.
您现在可以尝试说服用户安装它(如果可能)或关闭正在使用该服务的功能。
You can now try to convince the user to install it (if possible) or disable the feature that is using the service.
随着谷歌播放服务是不是在清单中声明的功能您的应用程序应该安装罚款的任何设备,但可能会崩溃以后,如果你正在使用API,而不检查它们是否可用。
As the Google Play Services is not a feature declared in the manifest your app should install fine on any device but may crash later on if you are using the APIs without checking if they are available.
您可以尝试用仿真器的行为。只要创建一个AVD没有谷歌的API,并把你的应用程序就可以了。
You can try the behaviour with the emulator. Just create an AVD without the Google APIs and put your App on it.
这篇关于谷歌Play业务:如何处理那些没有谷歌播放设备?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!