I need to provide auto login functionality. I come up with 2 options:
- save user name and password in file.
- save user name and password in preferences.
Which option should I take? Which will be better?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Both seem viable options. However my vote goes to
Preferences. Mainly because you would not have to deal with all the checkedIOExceptions. The values either exist or don’t. In both cases, no exceptions at least.Do remember to do an encryption/digest of the username/passwords before you save them.