B4A Library B4A and B4J phonevalidator library

Discussion in 'Additional libraries, classes and official updates' started by JackKirk, Jun 11, 2018.

  1. JackKirk

    JackKirk Well-Known Member Licensed User

    At Erel's suggestion I have relocated this library to here - see this thread for how it came to be:

    This library is a super simple wrap of google's libphonenumber library.

    The only functionality exposed is to validate a phone number.

    Private Sub Process_Globals
    Private Obj_phonevalidator As PhoneValidator
    End Sub

    Private Sub FOO_sub(phoneno As String)
    Private good_no as Boolean = Obj_phonevalidator.Validate(phoneno, "AU")
    End Sub
    AU is the default country code - always uppercase, AU = Australia, US = ...

    If you specify a default country code then you can test phone nos using the nomenclature internal to that country.

    If you set default country code to "" then all phone nos to be tested must be in E.164 format (https://en.wikipedia.org/wiki/E.164) otherwise result will be false.

    You must also install libphonenumber-8.9.7.jar (as at writing - the latest and greatest) to your B4A additional libraries folder, I got it from:



    Attached Files:

  2. Multiverse app

    Multiverse app Active Member Licensed User

    Great work!
  3. JackKirk

    JackKirk Well-Known Member Licensed User

    A note - I have just successfully run this library in B4J.

    Just copy the .jar and .xml from the zip in post #1 to your B4J additional libraries folder.

    Also copy the libphonenumber-8.9.7.jar to your B4J additional libraries folder.

    Tick the phonevalidator library in your B4J Library Manager, cobble together a bit of code similar to post #1 and bang - it works!!!
  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