Listing all country codes of phone numbers

I am an android developer. I am using the libphonenumber library along with java.util.Locale class to complete this as follows. It may be late response, but hope it helps someone like me in future. Set<String> set = PhoneNumberUtil.getInstance().getSupportedRegions(); String[] arr = set.toArray(new String[set.size()]); for (int i = 0; i < arr.size(); i++) { Locale locale … Read more

Extract code country from phone number [libphonenumber]

Okay, so I’ve joined the google group of libphonenumber ( https://groups.google.com/forum/?hl=en&fromgroups#!forum/libphonenumber-discuss ) and I’ve asked a question. I don’t need to set the country in parameter if my phone number begins with “+”. Here is an example : PhoneNumberUtil phoneUtil = PhoneNumberUtil.getInstance(); try { // phone must begin with ‘+’ PhoneNumber numberProto = phoneUtil.parse(phone, “”); … Read more

tech