如何设置没有Google Play服务的Android模拟器

时间:2015-10-13 10:19:23

标签: android intellij-idea

客户要求我制作一个我的应用版本,以便在没有Google Play服务的设备上运行。

有没有办法告诉Android模拟器在不使用GPS的情况下运行应用程序?

然后我可以测试代码以确保它在客户端设备上运行。

1 个答案:

答案 0 :(得分:4)

使用不包含Google API的系统图片。

您可以在照片中看到两种类型的图像。

包含它的那些将被命名为Google Api系统映像 , 或者您可以使用genymotion,默认情况下没有安装google apis。

另外,请确保您可以使用此方法检查是否已安装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("MY TAG GCM", "This device is not supported.");
            finish();
        }
        return false;
    }
    return true;
}

enter image description here