Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

android how to get the emergency number to call

I see there are plenty of examples on how to call a number, and I also see that I can only have it pop up the dialer to go to an emergency number. But in all those example they hard coded "911" as the number to use. well this works fine in the US but since android phones are sold in other countries and thusly there is the possibility that my app will be bought by someone not in the US, or that someone who lives in the us may take their phone overseas; is there a way then my app can realize it's not in the us and thusly has to use a different number to call emergency service and what that number would be?

So to sum up I'd like to know if there is a way I can have it so when the app goes to bring up the dialer with the emergency number for the country it's in, with out having to know that number at complie time?

like image 290
Kit Ramos Avatar asked Feb 11 '11 16:02

Kit Ramos


1 Answers

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");
}

numbers will be a comma separated list.

like image 111
Robby Pond Avatar answered Sep 27 '22 19:09

Robby Pond