×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Regular Contributor
    Join Date
    Nov 2008
    Posts
    75

    Determing which country an App is in

    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.
    Cheers,

    Matt Brenner
    UnME2, Inc.

  2. #2
    Registered User
    Join Date
    Oct 2009
    Location
    Noida
    Posts
    941

    Re: Determing which country an App is in

    I tested the above given URL and got this:

    Phone: +919817864547

    Country: India
    ISO Numeric Country Code: IND
    ISO 3-letter Country Code: 356


    I can see some Issue here - it display's numeric code as IND and 3-letter country code as 356 -- which just the reverse.
    Please check.
    Thanks,
    Ekta

  3. #3
    Regular Contributor
    Join Date
    Nov 2008
    Posts
    75

    Re: Determing which country an App is in

    Ooops, I was careless. I've fixed the bug, thanks for pointing it out.
    Cheers,

    Matt Brenner
    UnME2, Inc.

  4. #4
    Registered User
    Join Date
    Oct 2009
    Location
    Noida
    Posts
    941

    Re: Determing which country an App is in

    Nice effort, hope it will help other developers.
    Thanks,
    Ekta

Similar Threads

  1. manufacturing country
    By afoysal in forum General Development Questions
    Replies: 2
    Last Post: 2008-11-29, 12:13
  2. determing permission settings
    By Larry101 in forum Mobile Java General
    Replies: 4
    Last Post: 2008-07-11, 11:54
  3. How to get the country code or country name
    By gpalvia in forum Symbian User Interface
    Replies: 1
    Last Post: 2008-02-26, 18:18
  4. Determing size of file http server
    By msulaiman in forum Symbian Networking & Messaging (Closed)
    Replies: 1
    Last Post: 2007-03-28, 16:22
  5. Determing MMAPI on Series40
    By mauricesibrandi in forum Mobile Java Media (Graphics & Sounds)
    Replies: 2
    Last Post: 2003-10-29, 11:54

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×