0

I have a pretty basic app that uses Firebase.io for user authorization. I've found some things on how to set up so you can recognize returning users and start them on a different screen as first time users by setting a Boolean value in getSharedPreferences. I've seen apps that do this, like Discover (a banking app) allows you to set up a 4 digit pin to login with instead of always entering your username and password. Does anyone know how this is achieved, where I can look for a tutorial or more info on it?

My first idea was that you would store the pin in getSharedPreferences but I couldn't find anything about that and I'm not sure how secure that would be.

John
  • 1,808
  • 7
  • 28
  • 57
  • Why can't you use SharedPreferences? – Jas Mar 08 '16 at 12:30
  • That was my first idea but I didn't find anything on that being good/bad so I wasn't sure if that was the way to go. – John Mar 08 '16 at 12:32
  • 1
    You can use SharedPreferences for this purpose and the data will persist until and unless you uninstall app – Jas Mar 08 '16 at 12:33
  • Ok thank you! I'll give that a shot – John Mar 08 '16 at 12:37
  • 1
    Yes, but don't store your "real" pin, that is, encrypt it in `MD5` for example, `sharedPreferences` can be seen by anyone who has access to mobile...@Shane – Aspicas Mar 08 '16 at 12:37
  • Ok thanks, thats what I was thinking also – John Mar 08 '16 at 12:39
  • @Aspicas Not if he stores it as private and it can only be accessed by this application – Jas Mar 08 '16 at 12:43
  • @Jas no problem, if you have ur device rooted you can open file, yes on my phone at least... on folder `data/data/com.packageapp.nameapp/` – Aspicas Mar 08 '16 at 12:45
  • Obviously you cannot save any data as private if your phone is rooted – Jas Mar 08 '16 at 12:47
  • There is no way to make your data 100% secure. The best you can do is to make it as hard as possible to get. – Jas Mar 08 '16 at 12:49
  • 1
    yes but so many people have a rooted device, and we must bear in mind, therefore, i said that better way it's store data encrypted. Although in my opinion, `sharedpreferences` should not be to save login data, well... yes, you can use but it's not secure. I agree with @Jas `There is no way to make your data 100% secure.` – Aspicas Mar 08 '16 at 12:52
  • 1
    Check this http://stackoverflow.com/a/30149030/4494555. @Shane – Jas Mar 08 '16 at 12:56

0 Answers0