简体   繁体   中英

How do I limit the usages of an Android app

I'm building app which consists on a test. It can be done only once, so I'd like to create a system which checks if the app has been opened before and if the answer is yes then it prevents to open it again. I was thinking to write a file inside the app as soon as the user open it the first time, so on the next startup I can check if it exists or not, but if the user deletes and reinstall the app it doesn't work anymore. How can I improve this method?

Are you constrained to using local storage? Or can you use a cloud based solution?

If you can use the internet, you could just store device IDs or some other form of unique identification that is checked every time the application is opened. If the ID already exists in your remote store, don't open the app etc.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM