Android - Google Map v2 - need update google play service on device

后端 未结 2 1698
情书的邮戳
情书的邮戳 2020-12-22 01:30

i use SDK 21 and i develop on google map v2 when i want install apk on device , device need latest version of google play service.

My questions are:

1

2条回答
  •  清酒与你
    2020-12-22 02:00

    1 - have android devices google play service default

    No, not all devices have google play services installed by default.

    2 - is it true to ask customer to install this service ?
    3 - if two question is yes , how can i embed this service on my project that i just notify customer to service installation and my project install this service by itself

    Normally you would check if the google play services are installed on the device with GooglePlayServicesUtil.isGooglePlayServicesAvailable(this);, and then display an error dialog where it links to google play services app on Google Play market.

    Something like this:

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

    For more info you can take a look over this link: http://developer.android.com/google/play-services/setup.html#ensure

提交回复
热议问题