Reputation: 9268
I created an application but I want to add a password authentication every time the user open it. When it's the first time to open the application, the user must first input a password and the application should have a settings for changing the password. Does anyone can suggest me how to do this? Thanks
Upvotes: 0
Views: 790
Reputation: 1540
Look into android preferences and store a boolean that indicates whether the application has ever been launched. Then have the first activity in your program check that value, if it is true (first launch), launch an intent for your sign up activity, if it is false (user has used the program, thus, a password should have been set) launch an intent for a user sign in activity.
As far as changing the password, I would have another activity for doing so, which can be launched from anywhere you feel is applicable.
Upvotes: 2