Identificating user with Google account in Android application
I want 开发者_开发百科to communicate with the server from my android app. The user needs to be identified, so somekind of login must be implemented.
Can I just take the Google account from AccountManager and be sure that it doesnt return any account the current user isnt logged in to?
That way there wouldnt be any need to ask any passwords or anything. It would be used only on first login, so that I could get some userID from the server.
The Device ID may provide the uniqueness you are looking for:
Settings.Secure.getString(getContentResolver(), Settings.Secure.ANDROID_ID)
精彩评论