How to check Google Play services version?

前端 未结 12 1180
走了就别回头了
走了就别回头了 2020-11-28 03:44

In my application, I need to check Google Play services version (which is installed in user\'s device). Is it possible ? And if yes, how can I do that? I searched Google but

12条回答
  •  感情败类
    2020-11-28 04:20

    int status = GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(this);
    if(status != ConnectionResult.SUCCESS) {
         if(status == ConnectionResult.SERVICE_VERSION_UPDATE_REQUIRED){
            Toast.makeText(this,"please update your google play service",Toast.LENGTH_SHORT).show();
         }
         else {
            Toast.makeText(this, "please download the google play service", Toast.LENGTH_SHORT).show();
         }
    }
    

提交回复
热议问题