How to integrate google sign-in in android app

Prerequisites

Google Sign-In for Android has the following requirements:

  • A compatible Android device that runs Android 2.3 or newer and includes the Google Play Store or an emulator with an AVD that runs the Google APIs platform based on Android 4.2.2 or newer and has Google Play Services version 9.0.2 or newer.
  • The latest version of the Android SDK, including the SDK Tools component. The SDK is available from theAndroid SDK Manager in Android Studio.
  • A project configured to compile against Android 2.3 (Gingerbread) or newer.
  • The Google Play Services SDK:
    • In Android Studio, select Tools > Android > SDK Manager.

Scroll to the bottom of the package list and select Extras > Google Play services. The package is downloaded to your computer and installed in your SDK environment at android-sdk-folder/extras/google/google_play_services.

 

Steps:

  1. Go to the link https://developers.google.com/identity/sign-in/android/start-integrating#prerequisites and click on button GET A CONFIGURATION FILE.

1

2. On the next page, select the project name and package from the drop-down box. You can also create a new package. Then, click on Choose and configure services.

2

3. Select Google Sign-In and click on Enable. Ensure that the SHA-1 key is same as the one you have used while creating credentials. Click on Enable Google Sign In.

 

2

4. Download the google-services.json file and place it in your app/ directory of your Android project. This file contains the API key and the OAuth Client ID of your mobile application.

 

admin Author

Leave a Reply

Your email address will not be published. Required fields are marked *