Best File Storage Space for Trail Period

I need to have a trial period (7 days) in my application. From this I learned that you can do this by saving a permanent file, database, or general preferences .

Where can I save this file so that the user cannot see or delete it.

If I put this logic in a Sharedpreference or a file with the " data/data/packagename " contour, when the application is deleted, the whole story will be lost.

Any other workarounds / ideas?

Note: there is no server, the application runs locally without the Internet.

+4
source share
3 answers

I would say that encrypting your file and then saving it in a random place would be a better workaround. Thus, even if the user has access to this file, he / she can at least say this to the target and delete it anyway. And Android also supports encryption.

Take a look at them to get started:

Android Crypto implementation

Android Developer: Crypto Package Summary

+1
source

You can store it as hidden, so there is no way to delete it by the user

see this

0
source

I would say make application data that cannot be removed from the manifest as follows:

 android:manageSpaceActivity="YourStartingActivity" 

in the application tag.

Now place the application in the database or application folder. This solution will save you from clearing application data. Now for removal. Make a widescreen receiver that starts when any application is removed from the device. As soon as the user tries to delete your application, you can catch it through the receiver and prevent it. This broadcast receiver may be in a separate class, such as the Watcher class, that will be installed with your application. You can do it easily. There are many examples.

0
source

Source: https://habr.com/ru/post/1416332/


All Articles