Skip to content

Instantly share code, notes, and snippets.

@truedem
Created October 4, 2016 18:44
Show Gist options
  • Save truedem/bca0787ffafa6f34eb99fe098e6ed75b to your computer and use it in GitHub Desktop.
Save truedem/bca0787ffafa6f34eb99fe098e6ed75b to your computer and use it in GitHub Desktop.
Installation of TLS 1.2 on Android 4.* devices
try {
SSLContext.getInstance("TLSv1.2");
ProviderInstaller.installIfNeeded(this);
} catch (GooglePlayServicesRepairableException e) {
// Thrown when Google Play Services is not installed, up-to-date, or enabled
// Show dialog to allow users to install, update, or otherwise enable Google Play services.
GooglePlayServicesUtil.getErrorDialog(e.getConnectionStatusCode(), (Activity) context, 0);
} catch (GooglePlayServicesNotAvailableException e) {
Log.e("SecurityException", "Google Play Services not available.");
} catch (Exception e) {
e.printStackTrace();
}
@truedem
Copy link
Author

truedem commented Oct 4, 2016

Installation from Google services.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment