1. Are you ready for the Galaxy S20? Here is everything we know so far!

Fun with LVL (license verification library)

Discussion in 'Android Development' started by RLScott, Apr 26, 2019.

  1. RLScott

    RLScott Newbie
    Thread Starter

    I think I am having success so far integrating license checking in my app. I have mostly followed the recommended use of a ServerManagedPolicy. It is neat that when you download the LVL and integrate it into your app, you get a copy of the source that you can easily customize, and I have.

    My customized ServerManagedPolicy maintains a new variable called mLastDefinitiveResponse, similar to the existing mLastResponse. The difference is that mLastDefinitiveResponse is set to either LICENSED or NOT_LICENSED when either of these responses are returned from the market server. It is unchanged when any other response is received. So when a license check is done in my application and my callback's "dontAllow" method is called, I can query mLastDefinitiveResponse (available through a public getter that I added to ServerManagedPolicy) to see what the last definitive response was. If that response was LICENSED I want to allow the user to continue to use my app regardless of any retry timeouts. My reason is that my app is a utility that might be used almost all the time in places and on devices were there is no network connection. (Don't ask. It's a niche app.) So my licensing policy is more liberal than the standard ServerManagedPolicy, and I am OK with that.

    When I get a "dontAllow" callback and the last definitive response was NOT_LICENSED, I throw up an AlertDialog telling the user I am switching to the play store, and then I call mChecker.followLastLicensingURL() where mChecker is my LicenseChecker object. And it works. Since the app is still in development, the responses from the Google Play Store are static and set by me in the developer console. And that is working fine too. (There is a delay of up to several hours between when I change the static response and when that new response is returned by my licensing query.) But here is my question. When followLastLicensingURL() takes me to Google Play, it shows my app with buttons for "UNINSTALL" and "OPEN". I guess that is because that is what the Play Store shows when you go to an app that is already installed. But if I really were running a bootleg copy of my app, would the Play Store give me the option of purchasing the app at this point? I really don't know how to test that until I actually release a production version of my app.
     



    1. Download the Forums for Android™ app!


      Download

       
Loading...
Similar Threads - Fun LVL license
  1. App Update
    Replies:
    0
    Views:
    208
  2. App Update
    Replies:
    0
    Views:
    201
  3. genie77
    Replies:
    13
    Views:
    1,696
  4. Cinemato
    Replies:
    1
    Views:
    210
  5. App Update
    Replies:
    1
    Views:
    428
  6. genie77
    Replies:
    3
    Views:
    561
  7. Rad Brothers
    Replies:
    1
    Views:
    820
  8. App Update
    Replies:
    0
    Views:
    312
  9. musicvegan
    Replies:
    0
    Views:
    276
  10. MoodyBlues
    Replies:
    20
    Views:
    2,080

Share This Page

Loading...