如何在没有Google Play服务的情况下设置Android Emulator

如何在没有Google Play服务的情况下设置Android Emulator,android,intellij-idea,Android,Intellij Idea,一个客户要求我制作一个应用程序版本,在一个永远不会有谷歌游戏服务的设备上运行 有没有办法告诉Android Emulator在不使用GPS的情况下运行应用程序 然后我可以测试代码以确保它在客户端设备上工作。使用不包含google API的系统映像 你可以在照片中看到两种类型的图像 包含它的将被命名为谷歌Api系统图像 , 或者你可以使用genymotion,默认情况下它没有安装google API 还要确保您可以使用此方法检查是否安装了Google play服务 private boo

一个客户要求我制作一个应用程序版本,在一个永远不会有谷歌游戏服务的设备上运行

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


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

使用不包含google API的系统映像

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

包含它的将被命名为谷歌Api系统图像 , 或者你可以使用genymotion,默认情况下它没有安装google API

还要确保您可以使用此方法检查是否安装了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;
}

使用genymotion emulator默认情况下不使用Google服务。