public final class CountryHelper extends Object
Modifier and Type | Field and Description |
---|---|
static int |
COUNTRY_NOT_FOUND |
Constructor and Description |
---|
CountryHelper() |
Modifier and Type | Method and Description |
---|---|
static Country |
getCountryByIsoCode(String isoCode)
Finds a country by its iso code.
|
static Collection<Country> |
getCountryList()
Gets the whole list of both supported/available countries.
|
static String |
getDefaultCountryISO(Context ctx)
Gets the default Country ISO Code, retrieved from user's device (this is done by using the
TelephonyManager |
static int |
getPositionOfCountryWithIsoCode(String isoCode) |
public static final int COUNTRY_NOT_FOUND
public static Collection<Country> getCountryList()
public static Country getCountryByIsoCode(String isoCode) throws NotValidCountryException
NotValidCountryException
.isoCode
- is the iso Code of the Country that we're looking for.NotValidCountryException
- occurs when the iso code
country search fails (in this case the country is not supported
by this application.)public static int getPositionOfCountryWithIsoCode(String isoCode) throws NotValidCountryException
NotValidCountryException
public static String getDefaultCountryISO(Context ctx)
TelephonyManager