B4A Library Licensing library

Discussion in 'Additional libraries, classes and official updates' started by Erel, Sep 11, 2011.

  1. Erel

    Erel Administrator Staff Member Licensed User

    This library allows you to use the market services to protect your application.
    See the tutorial for more information: http://www.basic4ppc.com/forum/basi...ur-android-application-licensing-library.html
    The documentation is available here: Basic4android - Licensing

    Installation instructions:
    - Unzip the attached file and copy Licensing.jar and Licensing.xml to the internal libraries folder (default): C:\Program Files\Anywhere Software\Basic4android\Libraries

    V1.21 - Adds protection from NullPointerException error reported.
    V1.20 - Fixes an issue related to Android 5.

    Attached Files:

    Last edited: Apr 19, 2016
  2. magarcan

    magarcan Active Member Licensed User

    :sign0098: Thanks for the lib.
  3. peacemaker

    peacemaker Well-Known Member Licensed User

    Ready !?!
    Suuper !
  4. palmzac

    palmzac Active Member Licensed User

    Great Job ! :sign0098:

    Thank you !
  5. Erel

    Erel Administrator Staff Member Licensed User

    Version 1.10 uploaded to the first post. This version fixes a bug that could cause the events to run in a secondary thread instead of the main thread.
  6. straybullet

    straybullet Member Licensed User

    I'm really having issues, maybe its me but I followed the tutorial, I get licensed passed, when it should be. It is set in my console to NOT_LICENSED, but it still allows every account I tried to run my app.

    My code is too big to paste here, but I will gladly export it to a zip if Erel can look at it
  7. eps

    eps Well-Known Member Licensed User

    Not really the right area to post a Q about this, but... Have you read through the documentation, in the link in the top post?

    Have you put the 3 called subs in your code? Plus associated code, from within the example? I just copied these in and they get called... it seems to work for me.

    Sub lc_Allow

    Sub lc_DontAllow

    Sub lc_Error (ErrorCode As String)
  8. straybullet

    straybullet Member Licensed User

    Yes I have all the subs, I thought this was about the licensing library which others have posted issues with as well.

    Anyways I have followed what I thought was the tutorial to do this and the directions, but I could have missed something, just seems odd that the applications are reported as LICENSED when the console I set to NOT_LICENSED.
  9. eps

    eps Well-Known Member Licensed User

    Okay... Just checking as you didn't post any code.

    There are 2 scenarios.

    1) test, you test the licensing part to ensure that it works. The App hasn't been purchased from the Market, otherwise it's 2) and should pass licensing as expected... If you are testing tyou have to realise that it will store a local key and if you indicated licensed then it will temporarily allow use of the App, otherwise if a licensed user didn't have an interner connectionit would halt their use of the App.. I think you have this scenario. You should read the other thread and set and save the test console response to unlicensed, save this and wait some time, poss up to 1hr. But in the meantime clear the App cache on the phone and then restart the phone. Now try your App... It should disallow use.

    2) App has been purchased or downloaded from the Market, in this case the App is licensed to be used. So the test console response will not apply.

    The two are quite separate..
  10. JonPM

    JonPM Well-Known Member Licensed User

    Just wondering, if you use this library is there any way to tell if there are unauthorized attempts to access your apps? I mean are there any notifications of unauthorized users trying to use your (pirated) app?
  11. Erel

    Erel Administrator Staff Member Licensed User

    There are no such notifications.
    gmilias likes this.
  12. metrick

    metrick Active Member Licensed User

    I have updated my app with license library, the app keeped closing application right after launched if wifi / internet accesed disable. when internet acces is on the app launched and close right after, only after several attemps the app will work. Anybody have the same issues?
  13. Erel

    Erel Administrator Staff Member Licensed User

    It gets closed because the DontAllow event is raised. You can show a message there instead of immediately closing the application.
  14. metrick

    metrick Active Member Licensed User

    I did show a message "Closing App" at DontAllow event.
    This raise question; if user purchased my App can they use the App without internet access? I can't see to launch the App at all without internet accessed.
    I still would like the App to work for user without data plan.
    What is the best way to handle user without data plan?
    Does the Lib has the building functions to check for licensing when user is back on wifi/internet?
    Last edited: Feb 7, 2012
  15. Erel

    Erel Administrator Staff Member Licensed User

    Once the user is verified the status is cached. So the user can later run the program without an internet connection. At the beginning the cache expires pretty quickly.

    You can read more about it in Google's documentation.
  16. Falco32

    Falco32 Member Licensed User

    Binding to licensing service.

    i have problems with google licensechecker on some devices
    most it works but on some devices i become this error message
    after start the license check

    Binding to licensing service.
    Could not bind to service.

    have you any solution for this ?
  17. Erel

    Erel Administrator Staff Member Licensed User

    Are they installing your app through Google Play?
  18. Falco32

    Falco32 Member Licensed User

  19. Erel

    Erel Administrator Staff Member Licensed User

    Do you have a full error message (with the stack trace)?
  20. Informatix

    Informatix Expert Licensed User

    I have a problem with this library. As I check the license in all activities (since the first screen of my app can be any activity), I put the code in a code module to avoid repeating it. But I have an exception occuring because the "allow" sub is not found (even when I set the EventName to an empty string). I don't have any use of this event and I cannot place its handler in a code module, so how can I get rid of it?
    Last edited: Oct 21, 2013
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice