In some paid apps, it shows you a dialog so you can buy the full version of the app, and in others it's the 30-day trial.
How to apply an expiration date to an app in Android?
In some paid apps, it shows you a dialog so you can buy the full version of the app, and in others it's the 30-day trial.
How to apply an expiration date to an app in Android?
SO , SO , mobile-trial inspired answer
Ways it could be implemented, from simplest to bypass to more complex.
First method save the install date to
base de datos
,fichero interno o externo de la app
or useshared preferences
. But it is very likely that the user will bypass the trial time restriction: by uninstalling and reinstalling the app , if an external location is used for the file, the user may not notice the residue.Second method: use a fixed deadline
hard bomb-time
, that is, for all users, that date expires. It is easy to bypass that restriction, just change the system time to a date before the deadline , for the user it can be a bit cumbersome to do it often and decide to buy.Third method of all the others is the safest (but not infallible) that if it requires more resources, connection to
internet
,servidor web propio
, is to create a unique identifier remote checker, it can be obtainedgetDeviceId
from the device and check the remote database if it exists , get the installation date, if it doesn't exist add a new entrygetDeviceId : fecha agregación
. If the device does not have internet, the user can be warned and the app can be terminated.Code of each method
not checked if they work:
Example of the first method using
SharedPreference
Example of the second method using
time-bomb
Example of third method response from user @Martin_christmman implement https://github.com/mobile-trial