Google Plus


 

Steps to do before:
  1. Open the Google Cloud Console.
  2. If you haven’t created the API project yet, click CREATE PROJECT. Give the name of the project and click Create.
    gcm_demo3
    g+ create project
  3. In the sidebar on the left, click APIs and auth. In the displayed list of APIs, Enable Google+ API service.
    g+ API Enable
  4. In the sidebar on the left, click APIs and auth and Credentials. On OAuth content screen provide the project name.
    g+ client ID
  5. Select OAuth 2.0 Client ID under Add Credentials to create a new Client ID.  Now select Android Application.
  6. Enter the details like Name for this Client ID and package name and SHA1 fingerprint.
    g+ create client ID
  7. Now Turn Deep Linking from Google+, later in this tutorial you will learn why you need this.
    g+ deep linking
  8. Note down the Client ID we will use this in our android application project.
    g+ OAuth client ID

 

 

Step 1 : Select File -> New -> Project -> Android Application Project. Fill the forms, create “Blank Activity” and click “Finish” button.

Step 2 : Open res -> layout -> activity_main.xml and add following code :

Step 3 : Open src -> package -> MainActivity.java and add following code :

Step 4 : Open AndroidManifest.xml and add following code :

Step 5 : Open build.gradle(Module: app) and add following code :

ScreenShot:

google_plus_login

Download SourceCode