Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 264
JohnMoll Avatar asked Oct 13 '15 10:10

JohnMoll


1 Answers

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

enter image description here

like image 107
abdelrahman nazeer Avatar answered Oct 26 '22 00:10

abdelrahman nazeer