Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/229.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 安卓谷歌游戏服务_Android_Google Cloud Messaging_Google Play Services - Fatal编程技术网

Android 安卓谷歌游戏服务

Android 安卓谷歌游戏服务,android,google-cloud-messaging,google-play-services,Android,Google Cloud Messaging,Google Play Services,我使用谷歌Play服务开发了一个Android应用程序,使用GCM服务 在MainActivity中,在访问Google Play services功能之前,检查设备是否有兼容的Google Play services APK。在应用程序中,此检查在两个位置完成:在主活动的onCreate()方法中,以及在其onResume()方法中。像这样: if (checkPlayServices()) { // If this check succeeds, proceed with norma

我使用谷歌Play服务开发了一个Android应用程序,使用GCM服务

在MainActivity中,在访问Google Play services功能之前,检查设备是否有兼容的Google Play services APK。在应用程序中,此检查在两个位置完成:在主活动的onCreate()方法中,以及在其onResume()方法中。像这样:

if (checkPlayServices()) {
    // If this check succeeds, proceed with normal processing.
    // Otherwise, prompt user to get valid Play Services APK.
    ...
}
以及:

我的问题是:在一些国家,用户不能从GooGlePlay下载GooGlePlay服务,所以他们不能使用我的应用程序

有可能把谷歌游戏服务放在应用程序上吗?或者将它放在另一台服务器上,并提示用户从新位置下载Google Play服务

欢迎任何其他解决方案


致以最诚挚的问候,

即使使用Google Play Services库,您仍然需要在设备上安装它。专门用于检查Google Play服务(如果已安装,版本等)


调用
isGooglePlayServicesAvailable()
检查是否安装了它,如果安装了,请检查它的版本。如果resutCode未成功,则调用
GooglePlayServicesUtil.getErrorDialog()
并将错误代码传递给它。这将提示用户安装Google Play服务。

即使使用Google Play服务库,您仍然需要在设备上安装它。专门用于检查Google Play服务(如果已安装,版本等)


调用
isGooglePlayServicesAvailable()
检查是否安装了它,如果安装了,请检查它的版本。如果resutCode未成功,则调用
GooglePlayServicesUtil.getErrorDialog()
并将错误代码传递给它。这将提示用户安装Google Play服务。

在某些国家,Google Play在Google Play中不可用,因此用户无法安装。在某些国家,Google Play在Google Play中不可用,因此用户无法安装。
private boolean checkPlayServices() {
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();
    }
    return false;
}
return true;
}