B4A Library phonevalidator library

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

  1. JackKirk

    JackKirk Active Member Licensed User

    At Erel's suggestion I have relocated this library to here - see this thread for how it came to be:
    https://www.b4x.com/android/forum/threads/libphonenumber.63361

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

    The only functionality exposed is to validate a phone number.

    Usage:
    Code:
    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:

    https://mvnrepository.com/artifact/com.googlecode.libphonenumber/libphonenumber/8.9.7

    Enjoy...
     

    Attached Files:

  2. Multiverse app

    Multiverse app Active Member Licensed User

Loading...
  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