install android studio

Google SignIn in Android Studio

Google SignIn:

To integrate Google Sign-In into your Android app, configure Google Sign-In and add a button to your app’s layout that starts the sign-in flow.

Implementation:

1. activity_main.xml:


<com.google.android.gms.common.SignInButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/signInButton"
></com.google.android.gms.common.SignInButton>

2.mainactivity.java


GoogleSignInOptions signInOptions= new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_GAMES_SIGN_IN.DEFAULT_SIGN_IN).requestEmail().build();
googleApiClient=new GoogleApiClient.Builder(this).enableAutoManage(this,this).addApi(Auth.GOOGLE_SIGN_IN_API,signInOptions).build();

About the author

Generic Bytes

Hi! we are from Generic Bytes an aspiring bloggers with an obsession of things tech.This blog is dedicated to people who want to learn the technology.

View all posts

Leave a Reply

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