Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android: Should I call the LicenseChecker every time the app is opened?

So I have read the LVL docs backward and forward, and have it working with my app. I have seen the questions about the response being cached. But it still leaves me wondering, based on some of the wording in the LVL docs, does Google want us to call the license checker every time the app is initialized? Is that the safest way to implement this? Using the ServerManagedPolicy like Google suggests, do we just call the license check, and either run our app or do whatever we choose if they fail? One of my small concerns is the use of network data. They drill into us the need to be cautious of using resources without informing the user, and it seems to me this is a use of network data without letting the user know.

To add to this, is anyone experiencing any type of delay to their app due to this code? Due to the nature of my app, opening it and then waiting every time for an ok to come through the network would definitely distract from its use. Should I cache the response myself, or am I way over thinking this?

like image 986
Isaac Avatar asked Oct 14 '22 17:10

Isaac


2 Answers

You answered your own question; if you feel that calling the service every time you start would be disruptive (which it would, e.g. the user is out of coverage), then don't do it.

Google make no recommendations about how often to use the licensing service; it's down to how paranoid you as the application developer are about piracy, balanced with how much you feel constantly checking would annoy the user.

like image 112
Christopher Orr Avatar answered Oct 18 '22 02:10

Christopher Orr


Ok, fair, only check it once in a while.. But where can you "safely" store the information, that you should check it once a day only? Eg, the first time you start the app, you will check it. Result of LVL is valid: so you store the date of the last successful check. But where to store it? Using SharedPreferences ? Is this safe? Because if you have root access on your device you could access the preference and change the valid date (to either way in the future, an yes, ofcourse you can check that in the code :-))

PS. Sorry, could not make a comment :(

like image 36
Tom Avatar answered Oct 18 '22 01:10

Tom