×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Regular Contributor
    Join Date
    Mar 2006
    Location
    South Africa
    Posts
    178

    Determining country

    Does anyone know of a quick/easy way to determine what country the user of a MIDlet is in? I've come across a few System.getProperty() ones, but these all seem to return null. Is there any way to do this, other than asking?

  2. #2
    Nokia Developer Champion
    Join Date
    Nov 2007
    Location
    Rome, Italy
    Posts
    2,406

    Re: Determining country

    Have you tried the "microedition.locale" property? You could try using that and, if null, query the user to make him manually input its locale.

    Pit

  3. #3
    Regular Contributor
    Join Date
    Mar 2006
    Location
    South Africa
    Posts
    178

    Re: Determining country

    Yes, I tried that property. On my phone it just returns "en" for the language code and nothing for location. Does it ever return the country code?

  4. #4
    Super Contributor
    Join Date
    Apr 2003
    Location
    USA, CA
    Posts
    7,191

    Re: Determining country

    The only "reliable" way would be to find the mcc of the network provider. Unfortunately there is no access to that information from MIDlets.

    I think asking the user would be the most reliable way. You could only ask when you see that the time zone has changed (although you will miss some country changes that way for sure in Europe)...

    Hartti

  5. #5
    Registered User
    Join Date
    May 2008
    Location
    Surat Thani
    Posts
    260

    Re: Determining country

    Quote Originally Posted by Larry101 View Post
    Does anyone know of a quick/easy way to determine what country the user of a MIDlet is in? I've come across a few System.getProperty() ones, but these all seem to return null. Is there any way to do this, other than asking?
    In addition to locale, your best bet for determining the user's country using the MIDP APIs would probably be making a guess based on country code of the smsc. At least in my experience, the smsc country code seems to be same as the country code of the phone number associated with the SIM. Probably there are exceptions though and this technique of course just determines the SIM's home country, not user's current country, when roaming.

    The smsc system property (wireless.messaging.sms.smsc) seems to be available on S40 and S60 phones, and also several of other manufacturers' phones - see http://devices.j2mepolish.org/intera...nfoindex.faces

Similar Threads

  1. 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
  2. How to find Country when Mobile is on Roaming!!
    By awasthi_vivek in forum Symbian Networking & Messaging (Closed)
    Replies: 1
    Last Post: 2006-11-02, 08:01
  3. S40 Theme Studio and The Country Policy
    By Akuma_Fer in forum Series 40 & S60 Platform Feedback Archive
    Replies: 4
    Last Post: 2006-08-28, 08:44
  4. Replies: 0
    Last Post: 2003-09-26, 15:07
  5. undefined country codes in PKG
    By Jeepy in forum Symbian Tools & SDKs
    Replies: 2
    Last Post: 2003-04-23, 10:22

Posting Permissions

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