B4A Library B4A and B4J phonevalidator library

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:


EDIT: You should regularly update the libphonenumber-x.x.x.jar for reasons alluded to by Sandman at:


At 21 July 2019 this stands at 8.10.15:


You also need to edit the ...B4A/Additional Libraries/phonevalidator.xml to reflect this update.



  • phonevalidator.zip
    1.6 KB · Views: 169
Last edited:


Well-Known Member
Licensed User
Longtime 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!!!