Google Sign-In for Android lets the developer authenticate users using the same credentials they use on Google. Users will be able to sign in to your app using their Google credentials. Add the following dependency in your Gradle's build file to include the Google Sign-In package in your app:
compile 'com.google.android.gms:play-services-auth:8.4.0'
These are the main Google Sign-In API classes that you need to know about:
SignInButton
: This is the default Google Sign-In button. You need to add the default or a custom button to your app so the user can trigger the Sign-In flow. You can add the default button using this code in your layout file:<com.google.android.gms.common.SignInButton android:id="@+id/sign_in_button" android:layout_width="wrap_content" android:layout_height="wrap_content" />
This default button can be customized in size and color depending on the scope. For example, you can choose among these size values, which you can compare in the next screenshot...