Android App Development
iOS App Development
Flutter App Development
Cross Platform App Development
Hire on-demand project developers and turn your idea into working reality.
Big thanks to Webkul and his team for helping get Opencart 126.96.36.199 release ready!
In this blog,
We are going to show you how to integrate the google sign-in in your android application.
Google+ sign-in allow users to sign-in by your Android app with their existing Google account and get their profile information like name, email, profile pic and other details.
The main advantage of integrating G+ login is, you can encourage more users to your app by providing fast & easiest way of a registration process.
There are some requirements which is necessary while integrating g+
Step 1: Enable google+ API and Get configuration file
go to this link
Click on Get A Configuration file button
After clicking this button you have to Enable google service for your app with the application name and package name.
After fulfilling the above requirements click to Continue blue button.
You have to select the service that which service you want to add in your app.
Before Creating the configuration file We can Enable the Google Sign-In API,
And for enabling google sign-in api you have to provide the SHA-1 of your signing certificate:
The keytool utility prompts you to enter a password for the keystore. The default password for the debug keystore is android.
After Generating the SHA- 1
You can enable the Google Sign-in API
For more information: Signing your App
Then generate the google-services.json file. And download it.
Step 2: Add this configuration file to your project.
Copy the google-services.json file you just downloaded into the app/ or mobile/ directory of your Android Studio project.
Step 3: Add permission to your manifest.xml
Step 4: Add a plugin to your project in your top-level build.gradle and your app-level build.gradle files as follows:
1- In your sign-in activity’s onCreate method, configure Google Sign-In to request the user data required by your app
Configure sign-in to request the user’s ID, email address, and basic profile. ID and basic profile are included in DEFAULT_SIGN_IN.
2- Build a GoogleApiClient with access to the Google Sign-In API and the options specified by gso.
1- Add the SignInButton in your application’s layout:
2- If you want to customize the button’s size and color scheme. Then google gives the methods to customize:
3- In the Android activity (for example, in the onCreate method), register your button’s OnClickListener to sign in the user when clicked:
1- Simply call the function after clicking the sign-in button
2- In the activity’s onActivityResult method, retrieve the sign-in result with getSignInResultFromIntent.
3- After you get the sign-in result,
You can get the profile information.
Your email address will not be published. Required fields are marked*
Save my name email and website in this browser for the next time I comment.
Be the first to comment.
Enquiry or Requirement
If you have more details or questions, you can reply to the received confirmation email.