I'm working on an app that will be published on the Google Play store when finished. However, my company doesn't want everyone to be able to use the app, so they've requested that I protect it with a password so only our employees can use it. How do I make it so that my app requires a password the first time it starts only?
Asked
Active
Viewed 275 times
-2
-
Publish it to an account only company emails can access: https://support.google.com/a/answer/2494992?hl=en – Raghav Sood Jul 28 '16 at 16:43
-
Welcome to SO. We're not going to write that code for you. Come back when you'll have some effort to show. – Phantômaxx Jul 28 '16 at 16:43
2 Answers
0
You could store a shared preference that shows whether the app has been opened or not. The first time the user puts the password in set the flag and then check it in your onCreate method.

Ben
- 1,285
- 1
- 9
- 15
0
Authentication is a very wide subject and I would suggest you start familiarizing yourself with it before starting implementing anything. (just a starting point...)
As for the general idea, You can use Shared Preferences to save a flag that the user has authenticated. Every time your application starts, you check this flag. If the user has never authenticated himself, you present a Login screen.
Once the user gives the proper credentials, you update the flag and indicate that the application shouldn't prompt the user with the Login screen anymore.