简体   繁体   中英

How to set up Android Emulator WITHOUT Google Play Services

A client is asking me to make a version of my app to run on a device that won't ever have Google Play Services.

Is there any way to tell the Android Emulator to run the app without using GPS?

Then I can test the code to make sure it works on the clients device.

Use a system Image that doesn't contain google APIs.

you will find two types of images as you can see in the photo .

the ones the contain it will be named Google Api system image , or you can use genymotion it comes with no google apis installed by default.

Also to be sure you can use this method to check if Google play services are installed

    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;
}

在此输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM