Android how to get an emergency number to call

I see that there are many examples of how to call a number, and I also see that I can only open it to go to the emergency number. But in all of these examples, they were hardcoded "911" as the number to use. it’s good that it works great in the USA, but since Android phones are sold in other countries, and therefore it’s likely that my application will be bought by someone not in the USA, or that someone who lives in us can pick up your phone abroad; is there a way my application can implement this not in us and therefore should use a different number to call the emergency service and what is this number?

So, to summarize, I would like to know if there is a way I can have this, so when the application goes to call the dialer with the emergency number for the country in which he is, without having to know this number at the time of approval ?

+5
source share
1 answer

According to the source for PhoneNumberUtils.isEmergencyNumber () :

String numbers = SystemProperties.get("ril.ecclist");
if (TextUtils.isEmpty(numbers)) {
    // then read-only ecclist property since old RIL only uses this
    numbers = SystemProperties.get("ro.ril.ecclist");
}
Rooms

will be separated by commas.

+4
source

All Articles