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 = new Locale("en", arr[i]);
    Log.d(TAG, "lib country:" + arr[i] + "  "+ locale.getDisplayCountry());
}

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)