This class provides access to the system country detector service. This
service allows applications to obtain the country that the user is in.
The country will be detected in order of reliability, like
- Mobile network
- Location
- SIM's country
- Phone's locale
Call the {@link #detectCountry()} to get the available country immediately.
To be notified of the future country change, use the
{@link #addCountryListener}
You do not instantiate this class directly; instead, retrieve it through
{@link android.content.Context#getSystemService
Context.getSystemService(Context.COUNTRY_DETECTOR)}.
Both ACCESS_FINE_LOCATION and ACCESS_COARSE_LOCATION permissions are needed. |