Google plus API and Gmail API integration in android app - android

In android I need to create an app where user can login through google account and can access its basic profile information and its inbox mails also. How do I integrate google plus API and gmail API together.
Also please let me know how to integrate gmail API to access mails.

Google+ sign-in lets users sign in to your Android app with their existing Google account and get their profile information like name, email, profile pic and other details. By integrating google plus login in your apps, you can get all the user details in one shot. Not only login, you can do other things like posting to their g+ account, getting list of circles, friends list and lot more. The major advantage of integrating G+ login is, you can drive more users to your app by providing quicker & easiest way of registration process.
visit
http://www.androidhive.info/2014/02/android-login-with-google-plus-account-1/

Related

How To add Gmail Account Credentials in Static way to Access that account in Android App

I am doing an android app which uses only my Google account. I want to integrate my Gmail Account in my Android app. So each user who uses my app can use my Google account only . I want to set my Google account in static without using AccountManager Obj to display all email in their Mobiles.
Please Help me.
You can't do this. Gmail account cannot be bind to multiple device (there is a limit ... i don't know exactly but i know it)
Google keep rights to disable those account, check in google account android policy.
You got to let people use their own google play account.

App-engine authenticating google account and google plus at the same time

I am working on a project based on google mobile backend starter. This is set up to authenticate users using their google account - https://cloud.google.com/developers/articles/mobile-backend-starter-api-reference/#secmod
I now want to get a users name and profile image as defaults for their profile. I have implemented the google plus APIs which gives me the information that I want - https://developers.google.com/+/mobile/android/people
Unfortunately at the moment I am asking the user to log in to the application with their google account and then asking them to log in again to get their google plus information. So my question is this: is there a way to modify the google plus login such that it takes the authentication from mobile backend starter rather than requiring a separate login?
This is a similar question Can I use Google Plus sign in to authenticate my OAuth methods in app engine? but I specifically want my standard sign in to authenticate the google plus (rather than the other way around) as very few people have an android phone without a google account but a larger percentage dont have a google plus account
If in your application you provide a "Sign-in with Google" functionality then you can upgrade that functionality with "Google SignIn Plus". Please refer to the document [1].Also go through the document[2], it gives you an idea how to use the Google+Sign In with your android application.
[1]Google SignIn Plus: https://developers.google.com/accounts/docs/OpenID#update-to-plus
[2]Google SignInfor Android: https://developers.google.com/+/mobile/android/sign-in

Integrating facebook and google in same app and allow user to signin both simultaneously

Is it possible to integrate both facebook and google in one app so as to in allow user to sign in for both ... i.e use google game services for Real time multiplayer and then at the end, post the result on facebook .. so in a manner where my app would hold both sessions fb as well as google ?? is thing this possible ???
yes of course , you can use the google+ API and the facebook sdk in your API.
you begin by Login your users by googles+.
in the end, if the user wants to share anything in facebook you authenticate him with facebook sdk, then ask for permissions then publish what you want.
you can find many tutorials and samples about the authentication in google+ and facebook.
I don't want to give advertisements about libraries (and I didn't even test anyone of them...) , I hear about GigyaSDK. they have a good documentation of integration.

Login using Gmail credentials

Is there a way I can use Google credentials to get basic user info like
Email, Name, Gender
and use them in my application? Its like allowing user to login into my application using Gmail.
I asked the same here.
But the answer says:
You should not use Gmail for user authentication using Google
accounts. You can use Google + Sign-in for Android instead. This will
allow you to access the user's profile information upon getting the
required permissions using OAuth. Check out the guide here:
which i followed and everything worked fine.
But if a Gmail account has no GooglePlus profile, My application asks to create a GooglePlus account. Which makes me think I implemented a GooglePlus Login instead of Gmail Login.
Is the answer for my other question right? Meaning without a GooglePlus profile you cannot have a Gmail Login in Android?
If not how can I have a Google Login in my application?
A similar question here, with no replies.
Please help. Thank You
Try article on this Url : http://nilvec.com/implementing-smtp-or-imap-xoauth-authentication-in-java.html.
I think this will help you
I wouldn't confuse a "gmail" account and a "Google+" account as being different things. Really what you want is for a user to authenticate with their "Google account", which spans many services.
On Android, the easiest way to build authentication with Google accounts is to use the Google Play Services SDK, which includes services like Google sign in.
Google+ documents an end-to-end approach to using Google Play Services SDKs that cover the issues that you asked about by using the PlusClient:
Setting up the client
Getting the user's email address using either PlusClient.getAccountName() or the REST methods.
Getting the user's profile info using the PlusClient.loadPerson()
Documentation for using Google's OAuth2 to authenticate a user are provided at https://developers.google.com/accounts/docs/OAuth2Login. As the page notes, however, you and your users get additional features if they use a Google+ account and the Google+ Sign-in, but this is not necessary.
The scopes required are
https://www.googleapis.com/auth/userinfo.profile for name and gender
https://www.googleapis.com/auth/userinfo.email for the user's email address
Update: I should amend that these scopes are now deprecated, and scheduled for removal. See the URL above for details.

Can I use AccountManager to let users sign in with their Google account?

I'm creating an app that will need users to create an account. (Like Facebook or Twitter would require you to.)
BUT, since it's an Android app, should/can I let them sign in with their Google Account using AccountManager or some other service? It'd be very helpful if they could just sign in to their Google account and their settings and other options would be saved to that account.
Main questions summed up:
Is it possible to let a user just use their Google account in my app?
If so, do I use AccountManager to have them sign in and save account information/settings?
What are other options?
Yes, you can get users to log into their Google Services using their Google credentials, for example, I have an app on Google Tasks and I use the Android AccountManager to let users authenticate themselves using their Google account on the android device (No need for users to enter their password!)
There are some really good examples to get you started:
This is an in-depth look into how you can authenticate based on the users Android credentials, has an example of how things work and how the UI should be: http://www.finalconcept.com.au/article/view/android-account-manager-step-by-step-2
This is an example of getting AccountManager to work with a Google service like Google Tasks: https://developers.google.com/google-apps/tasks/oauth-and-tasks-on-android
The last example is using the same concept for accessing the Google Picasa service: http://code.google.com/p/google-api-java-client/wiki/AndroidAccountManager
The other options you have is to have users manually enter their username/password. For that you have to use a third party authentication API (like signpost for OAuth) for them to log in.
In my tasks/todo application I provide users both options to sign in, using their android credentials or using third party authentication for users that want to log in using some other account (an account which is not enabled on that device)
Let me know if you have more questions
Although it is a new development, Google Plus Sign-in introduced as part of Google Play Services can also be used. More info can be found at Android developers blog. See example implementation from Banjo app
There seems to be a big limitation - The user need to have Google+ app installed on the device to use this.
Also this is a pretty good blog if someone is interested in implementing the solution.
#Soham gave you some very useful links but he didn't correct one major error: AccountManager is the entity that manages the accounts on your Android device - it has nothing to do with your google account! you can use google account and create a NEW account on your device using the AccountManager.
The rest you can learn from the links Soham gave you.

Categories

Resources