public class PhoneNumberUtils extends Object
| Constructor and Description |
|---|
PhoneNumberUtils() |
| Modifier and Type | Method and Description |
|---|---|
static String |
formatNumberToE164(String number,
String countryIso)
Formats the provided number in E164 format.
|
static String |
getDefaultCountryIso(Context context)
Returns the default country iso which is inferred from the sim card info if a sim card is present,
or from the default locale settings otherwise.
|
static boolean |
isPossibleNumber(String number,
String countryIso)
Checks whether the given string is a possible phone number in the country with the provided country iso code.
|
public static String formatNumberToE164(String number, String countryIso)
number - The number to format.countryIso - The ISO 3166-1 two-letter country code.public static boolean isPossibleNumber(String number, String countryIso)
number - The number to check.countryIso - The ISO 3166-1 two-letter country code.public static String getDefaultCountryIso(Context context)
context - Application context.