Skip to main content

Enabling Sign-in APi in Google Developer console

We need to enable Sign-in Api for our application in google developers console to use google sign-in  in our application.

1 . first we need to create a project in google developers console
    visit google developers  console 
     https://console.developers.google.com/project
2 . Click on create project button you will see the below screen
   
3 . Enter project name and click CREATE . Then we are directed to project home page  which will look like this

4 . Next we need to add Google API to our project. click on library on left menu and search for google api
5 . Configure  OAuth consent screen , click on 'OAuth consent screen'
 6 . Enter Application name and email id everything else is optional and click save


 7 . Configure Credentials 
      Google uses this to ensure that your application is not fake application . For the purpose of development we use debug certificate. When we deploy our app on play store we need real certificate, steps for geeting it is 
https://developer.android.com/tools/publishing/app-signing.html
we only need debug certificate for development , it is identified by SHA1 fingerprint 
Steps for getting SHA1
  I . SHA1 can be accesed from debug keystore
      on mac or linux it is in the ~/.android directory
      on windows it is in the c/user/<username>/.android directory
 II . Run the following  command
      on mac/linux open terminal 
keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android
      on windows 
keytool -list -v -keystore C:\Users\arun\.android\debug.keystore -alias androiddebugkey -storepass android
 III . you will get output like this 
  you can find SHA1 in the output
  If you are not getting output and getting the error in windows
 "keytool is not recognized as internal or external command "
  click on following link
  keytool is not recognized as internal or external commad
now we got our SHA1 , so we can configure credentials
8 . Click o credentials on the left side and you will be asked to create credentials

9 . Click on create credentials , now you will be asked to select a access method select OAuth client ID
10 . Next you will get a screen like this
11 . Select android and enter Name,Package name and SHA1. Package name should be same as your application package name
 12 . click on create and your client id will be ready
13 . now you can start coding for your application with google sign in.
click here for creating android  app with google sign-in
Google sign-in in android app

Comments

Popular posts

Android List View using Custom Adapter and SQLite

following is a simple applicaton to create ListView using  Custom adapter.screenshot of the application  is like this . ListView is not used in android Anymore . We use  RecyclerView  and  CardView   in Android RecyclerView Demo is available on the following link http://androidtuts4u.blogspot.in/2017/04/android-recyclerview-example.html RecyclerView with Cardview Example is available on the following link http://androidtuts4u.blogspot.in/2017/09/android-card-view-example.html The ListView below the submit button is populated using Custom Adapter.Data is stored and retrieved using SQLite databsase. you can download the source code of this project from  google drive   https://drive.google.com/folderview?id=0BySLpWhqmbbdUXE5aTNhazludjQ&usp=sharing click on the above link ->sign into  your  google account ->add this to your google drive -> open it in google drive and download it. To create a simple ...

Swipe or OnFling Event Android

This  is a simple application Demonstrating Swipe or onFling() event on ListView. you can download the source code of this project from  google drive   https://drive.google.com/folderview?id=0BySLpWhqmbbdSVB4M0hXb0VxcU0&usp=sharing click on the above link ->sign into  your  google account ->add this to your google drive -> open it in google drive and download it. 1. Following is the MainActivity (DemoSwipe.java) of the application package com.arun.demolistviewswipe; import android.app.Activity; import android.content.Context; import android.os.Bundle; import android.view.GestureDetector; import android.view.GestureDetector.SimpleOnGestureListener; import android.view.Menu; import android.view.MotionEvent; import android.view.View; import android.view.View.OnTouchListener; import android.widget.ArrayAdapter; import android.widget.ListView; import android.widget.Toast; public class DemoSwipe extends Activity { ListView lvCountry; Strin...

Android Card View And RecyclerView Example

CardView Cardview lets you show information inside cards that have consistent look across the platform . CardView is introduced with material design through support v7 library. CardView extends frame layout and It can have shadows and round corners.     Cards can be used as independent views that serves as an entry point to more detailed information. CardView can also  be used with RecyclerView to display cards as list. In this example we are using Cardview with Recyclerview to show data as list of cards. Our Demo application contains vertical list of cards . Each card contain Movie name, movie poster and director name. screenshot of demo app 1. CardView and RecyclerView are supportV7 library widget . so we need to add dependency for both in app level build.gradle file . which is in the app folder compile 'com.android.support:cardview-v7:26.+' compile 'com.android.support:recyclerview-v7:26.+' build.gradle file is apply plugin: 'com.android.applicat...