BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 04-28-2011, 01:38 PM   #1 (permalink)
Knows Where the Search Button Is
 
Join Date: Apr 2010
Model: 8520
PIN: N/A
Carrier: T-Mobile
Posts: 25
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default getting country name from GPS

Please Login to Remove!

Hello, how can I get the name of the country the user of my app connects from?
Offline  
Old 04-28-2011, 02:46 PM   #2 (permalink)
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Post Thanks: 0
Thanked 34 Times in 33 Posts
Default Re: getting country name from GPS

You can get the MCC (country code) from IdenInfo of GPRSInfo, or you can use Locale.getCountry().

It's all in the javadocs.
Offline  
Old 05-05-2011, 02:29 PM   #3 (permalink)
Knows Where the Search Button Is
 
Join Date: Apr 2010
Model: 8520
PIN: N/A
Carrier: T-Mobile
Posts: 25
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Re: getting country name from GPS

Quote:
Originally Posted by Dougsg38p View Post
You can get the MCC (country code) from IdenInfo of GPRSInfo, or you can use Locale.getCountry().

It's all in the javadocs.
nah mate, I get a four digit code...

When I tried this String a = Locale.this.getDisplayCountry();
I got error: No enclosing instance of the type Locale is accessible in scope.
Offline  
Old 05-06-2011, 05:54 AM   #4 (permalink)
Knows Where the Search Button Is
 
Join Date: Apr 2010
Model: 8520
PIN: N/A
Carrier: T-Mobile
Posts: 25
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Re: getting country name from GPS

I don't meant to be rude, but does anyone help here?
Offline  
Old 05-06-2011, 07:43 AM   #5 (permalink)
BlackBerry Extraordinaire
 
Join Date: Jan 2006
Model: LEZ10
OS: 10.0.10
Carrier: Rogers CA
Posts: 1,704
Post Thanks: 20
Thanked 77 Times in 68 Posts
Default Re: getting country name from GPS

Quote:
Originally Posted by thatoulah View Post
I don't meant to be rude, but does anyone help here?
If someone knows how to do what you are asking, generally they will post help. The answer probably really depeds a lot on what version of the OS you are develping for. I know OS 6 provides greater location <-> address support through the ROC but I've never used the capability myself. Some times you just have to dig into the latest API documentation, and if you find what you need trace it back to see how much is available in the version you need.
__________________
My other Blackberry is a PlayBook.
Offline  
Old 05-06-2011, 08:07 AM   #6 (permalink)
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Post Thanks: 0
Thanked 34 Times in 33 Posts
Default Re: getting country name from GPS

I think I misread your original post. I thought you were looking for the phone country code.

Also, I think you took my answer too literally: when someone says "Look at Locale.getCountry()", they generally mean "look at the method getCountry in the Locale class". I *did not* mean to infer that I was giving you working source code. getCountry() is not a static method of Locale.

O think hrbuckley is closer to the point: you want to geolocate the phone based on the current GPS coordinates. There is a geolocation API in 6.0 (which I have not used). There are also various web services available that will provide address information from a set of GPS coordinates.
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads for: getting country name from GPS
Thread Thread Starter Forum Replies Last Post
FAQ: Difference between GPS vs A-GPS vs Antenna Triangulate (all 3 different things) Mark Rejhon GPS & Mapping 11 10-21-2008 11:53 AM
BB Bold GPS...assisted? Skeets General 9000 Series Discussion - Bold 21 07-30-2008 07:08 PM
Offline GPS Navigation IS possible with FULL North America maps! [GPS makers, read] Mark Rejhon GPS & Mapping 39 07-19-2008 05:41 PM
8110 GPS Frustration ChainsawDude General 8100 Series Discussion - Pearl 11 05-31-2008 08:26 AM
Review: Freedom Mini GPS John Clark BBF Reviews 40 01-01-2008 11:22 PM





Copyright 2004-2014 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.