Android Question Test the application for x days

Isac

Active Member
Licensed User
Longtime User
How can you do to test your application for 3 days?
Past 3 days the application stops asking for a password.
Has anyone tried it?
Thank You
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
It depends on the how secure you want it to be.

A simple solution is to create a file somewhere on the external storage with the current date. When your app starts check whether this file exists and if not create it.
If it exists read the stored time and compare it to the current time.

The file should NOT be saved in File.DirInternal or File.DirDefaultExternal as both these folders are deleted when the app is uninstalled.
 
Upvote 0

Isac

Active Member
Licensed User
Longtime User
The file should NOT be saved in File.DirInternal or File.DirDefaultExternal as both these folders are deleted when the app is uninstalled
Where should I save?

The user in this case can always change the date of the saved file?
 
Upvote 0

lemonisdead

Well-Known Member
Licensed User
Longtime User
Another idea : make a mix of Erel's proposal and a reverse solution :
  • first launch :
    • get the user's account e-mail address and send it to a server. Store the address on the server
    • if the address is not present on the server : create a file locally and store the date
  • each new launch :
    • check if the file exists
      • if the file doesn't exist : get the user's account e-mail address and send it to your server. If the e-mail address is stored on the server, reply negatively and don't create a file
      • if the file exists : check the date. If the date is after the 3 days, delete the file
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
The user in this case can always change the date of the saved file?

You can always encrypt you date string, keep it in ticks value, add a fixed string before encryption. .. there are many ways to at least make the user question him self "wff is this?"
Also, to ensure that deleting the file does not reset your trial period, make the app create a fîle somewhere with a "Never has run" string.. this way.. simple deletion will not reset your trial.
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
Look for the crypto lib in the libs forum... Plenty of examples to get you going... You can even choose different types of encryption
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…