B4A Library Library PhoneNumberValid

Discussion in 'Additional libraries, classes and official updates' started by MarcoRome, Jul 19, 2015.

  1. MarcoRome

    MarcoRome Expert Licensed User

    Hi all.

    This is simple library to check if PhoneNumber is Valid. Comeback is valid number, country, is mobile or no, etc.
    I used this free service: Phone Validate
    You have with Free account limit: 50 request / day.
    If you want illimited request or another documentation you can see HERE

    Is very simple:

    Version: 1
    • PhoneValidate
      • IsInitialized As Boolean
        Tests whether the object has been initialized.
      • initialize (numberphone As String, yourkey As String, Module As Object, EventName As String) As String

        For get key you go HERE

        Sub Globals
        'These global variables will be redeclared each time the activity is created.
            'These variables can only be accessed from this module.

        Private Label1 As Label
        Private Label2 As Label
        Private Label3 As Label
        Private Label4 As Label
        Private Label5 As Label
        Private Label6 As Label
        End Sub

        Sub Activity_Create(FirstTime As Boolean)
        'Do not forget to load the layout file created with the visual designer. For example:
        Dim checkphone As PhoneValidate
        "1-888-322-1122","Fe5pwHzYKdmshHMC2Kq7NUIN0X3Ap1J54u4jsn62nFgdNmBJX9", Me, "check_valid")

        End Sub

        Sub check_valid(valore As typeLevel)

        Log("Error: " & valore.error)
        Label1.Text = 
        "Error: " & valore.error
        Log("Valid: " & valore.valid )
        Label2.Text = 
        "Valid: " & valore.valid
        Log("Location: " & valore.location)
        Label3.Text = 
        "Location: " & valore.location
        Log("Country Code: " & valore.country_code)
        Label4.Text = 
        "Country Code: " & valore.country_code
        Log("Is mobile: " & valore.Is_Mobile)
        Label5.Text = 
        "Is mobile: " & valore.Is_Mobile
        Log("Local Number: " & valore.local_number )
        Label6.Text = 
        "Local Number: " & valore.local_number
        Log("Type Phone: " & valore.TypePhone )

        End Sub
        Is important that you have this library:

        Installation instructions:
        You have 2 way:

        1 LIBRARY
        - Unzip the attached file ( PhoneValidate-Lib.zip ) and copy PhoneValidate.jar and PhoneValidate.xml to the libraries folder
        - ValidatePhone-Example.zip is simple B4A

        2 CLASS
        - Available also Class. Unzip the attachment PhoneValidate.zip

        Thank you also Erel & DonManfred for support

        Screenshot 2015-07-19 17.06.38.png

    Attached Files:

    Dave O, dar2o3, analizer3816 and 5 others like this.
  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