Check availability of Google Play Services in android
This blog is about how we can check that Google Play service are available or not in Device.
First of all, we can Create a method which will check Play services status with Status code.
Now we can call this method with status code to check Service Status.
If there is an Error in Service code then you can get text regarding that Status code with below link.
Even you can get Error Dialog or show Notification/ show DialogFragment from instance of GoogleApiAvailability with following methods and passing statusCode.
Happy Coding
First of all, we can Create a method which will check Play services status with Status code.
private void checkService(int statusCode) { switch (statusCode) { case ConnectionResult.API_UNAVAILABLE: //API is not available in device break; case ConnectionResult.NETWORK_ERROR: //Network error break; case ConnectionResult.RESTRICTED_PROFILE: //Profile is restricted by google. break; case ConnectionResult.SERVICE_MISSING: //Plat Service is missing break; case ConnectionResult.SIGN_IN_REQUIRED: //service available but user is not signed in break; case ConnectionResult.SUCCESS:
//Result Sucess
break;
}
}
Now we can call this method with status code to check Service Status.
int statusCode =GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(context); checkService(statusCode);
If there is an Error in Service code then you can get text regarding that Status code with below link.
GoogleApiAvailability.getInstance().getErrorString(statusCode);
Even you can get Error Dialog or show Notification/ show DialogFragment from instance of GoogleApiAvailability with following methods and passing statusCode.
getErrorDialog() showErrorDialogFragment() showErrorNotification()
Happy Coding
buy telegram members
ReplyDeletebuy telegram channel users
buy telegram followers
buy telegram users
buy members telegram
buy users telegram
buy followers
buy users telegram
buy telegram member
buy telegram channel users