Hi,
I have searched this site looking for information about how to determine which country an app is running in. I've found some useful information, and solved the problem (approximately). I thought I would share what I have found to save others some trouble.
In Java ME there is no direct way (I believe) to ask the phone where it is. Locale is available (e.g. "EN") but it actually reflects a user preference, and doesn't have anything to do with physical location.
There are, however, some phone numbers that are accessible to Java ME programs. For example, this property is available:
"wireless.messaging.sms.smsc"
This phone number doesn't change (I don't think) as the phone moves from country to country, but it is surely a strong indicator of the "home" country of the phone. It appears to me that this phone number includes the international phone prefix for the country. So, if one can map phone numbers to countries the country location can be obtained.
This mapping is not difficult. Feel free to visit:
You'll see a form with a single field for phone number. Enter a phone number (include the country code). Please enter ONLY digits. Click submit and you'll see the country name, along with the international numeric and letter codes for the country.
Cheers,
Matt Brenner
UnME2, Inc.

Reply With Quote

