android - Get gmail profile image and full name -
I am preparing a login page for my app. I wanted to do the same thing that Twitter is working, they are helping the user and predefining some areas such as email, name and profile pictures. I have been able to get an email using the However, I can not see how I get the full name and profile picture? You need to use it to get it. GET_ACCOUNTS permission.
get public stable string email (reference context) {AccountManager accountManager = AccountManager.get (reference); Account account = received account (account manager); If (account == zero) {return tap; } Else {return account.name; }} Private Static Account getAccount (Account Manager Account Manager) {Account [] Accounts = Account Manager.GetXNetByType ("ComGF"); Account account; If (accounts.length & gt; 0) {account = accounts [0]; } Else {account = null; } Return account; }
Comments
Post a Comment