0

I have created an android application where user need to login to store some info like their score, level and so on which are not needed to make secured or open for all.

Now don't want to prompt user to login or sign up, My question is how my application can automatically grab users identical info like his gmail address for his android account ?

After getting the email i can send the email associating with the application result.

Thanks.

fean
  • 546
  • 4
  • 12
  • 37
  • Well you can always pop the log in when the application is installed and after that save information in application sandbox, and the user doesn't have to log every time. A user will most often own a single registered phone for an email :). Or if you want you can place a log out feature that wipe out the saved credentials. – Aurelian Cotuna Oct 05 '11 at 07:39

2 Answers2

1

You can store information on SharedPreferences

  • First register and play...blah blah, done gaming, write result to SharedPreferences

  • Next time loading, check/read SharedPreferences whether such info/data exists then process ... blah blah

Look up info on SharedPreferences: http://developer.android.com/reference/android/content/SharedPreferences.html

Pete Houston
  • 14,931
  • 6
  • 47
  • 60
  • thanks for your answer, but i don't want to use SharedPreference, or not the login or sign up any more, just want to identify the user by his mail address or any other info which is unique. – fean Oct 05 '11 at 07:54
0

There is a very good example of this in the Google IO videos, unfortunately I cannot remember which one it is.

Basically you create a UUID and store it in the shared preferences so that if it is uninstalled then it respects privacy.

That UUID is then used to key all information, if the user wishes to sign up proplery then this key is used and can later be associated with a google ID making the process completely seamless other than a single sign in.

I think it's in the 2010 videos, but I cannot remember the speaker's name.

There is a link that covers some of the basics here:

How can I get the UUID of my Android phone in an application?

Community
  • 1
  • 1
Moog
  • 10,193
  • 2
  • 40
  • 66