1

Is there any way to retreive the ISO Country Code/Country programmatically in Blackberry 5.0/6/0 devices

Rakesh
  • 14,997
  • 13
  • 42
  • 62
  • What do you mean? Get the country code of the country the device is currently located in? Or get the country code of a country by passing in its full string name? – Nate Dec 13 '13 at 11:03
  • Yes the country code of the device which is currently located in and other thing will be useful in knowing – Rakesh Dec 13 '13 at 11:27
  • @Rakesh You mean the CC of the language set in the device, or the code of the country the device is actually located? – Mister Smith Dec 13 '13 at 12:00
  • Getting Both will useful ,I am expecting both things also – Rakesh Dec 13 '13 at 12:47

1 Answers1

1

You can obtain the country from the mobile network (if a SIM card is present). This is called Mobile Country Code. It is a number that you can then map to a string. In the API you have GPRSInfo.getHomeMCC. You can also call RadioInfo.getMCC and even RadioInfo.getNetworkCountryCode, that will already return the text if the carrier supports it.

And to get the ISO code of the device language, you can call Locale.getDefaultForSystem().getCountry().

Mister Smith
  • 27,417
  • 21
  • 110
  • 193