1

我使用 SDK 21 并在 google map v2 上开发,当我想在设备上安装 apk 时,设备需要最新版本的 google play 服务。

我的问题是:

1 - 默认有安卓设备谷歌播放服务
2 - 要求客户安装此服务是真的吗?
3 - 如果两个问题是肯定的,我如何在我的项目中嵌入这项服务,我只是通知客户进行服务安装,我的项目自行安装这项服务

4

2 回答 2

5

1 - have android devices google play service default

No, not all devices have google play services installed by default.

2 - is it true to ask customer to install this service ?
3 - if two question is yes , how can i embed this service on my project that i just notify customer to service installation and my project install this service by itself

Normally you would check if the google play services are installed on the device with GooglePlayServicesUtil.isGooglePlayServicesAvailable(this);, and then display an error dialog where it links to google play services app on Google Play market.

Something like this:

int resultCode = GooglePlayServicesUtil.isGooglePlayServicesAvailable(this);
if (resultCode != ConnectionResult.SUCCESS) {
   if (GooglePlayServicesUtil.isUserRecoverableError(resultCode)) {
       GooglePlayServicesUtil.getErrorDialog(resultCode, this,
                    PLAY_SERVICES_RESOLUTION_REQUEST).show();
   } else {
       Log.i(TAG, "This device is not supported.");
       finish();
   }
}

For more info you can take a look over this link: http://developer.android.com/google/play-services/setup.html#ensure

于 2013-10-07T07:22:35.087 回答
1

您需要分离用于开发应用程序的 Google Play 服务,并将您的 Google Maps API V2 与安装在用户设备上的包嵌入。

一旦你理解了它,你就可以使用最新的包来开发你的应用程序。如果用户试图在他的手机上安装您的应用程序但他没​​有最新版本,如果他的手机支持,他将被提示从 Google Play 商店安装最新版本。

于 2013-10-07T07:19:02.650 回答