I’m testing the licensing system for android. Exactly I just compiled the sample project with ServerManagedPolicy and I have a question about it:
If I do:
Device's Internet=ON
Launch the app
Launch the check= Allow access
Device's Internet=OFF
Relaunch app and check= Allow access
Ok now lets see the problem:
Device's Internet=OFF
Launch the app
Launch the check= Don't allow access
Logically I don’t want that. Because the app will be blocked if the user launches the app without Internet, even if it was licensed. How can I solve that? My application needs to be connected to the Internet for working so there’s no problem in delaying that check
You may use a custom LicenseValidator class with a handleResponse() that would call dontAllow() on the License checker callback only when the policy returns LicenseResponse.NOT_LICENSED, and allow() in all other cases including network error.
And use also a custom Policy instead of the ServerManagedPolicy:
}
This is petty much what I did and it works fine.