views:

107

answers:

3

In GWT, is there a way to find out the user's physical location (country, state etc)?

A: 

You can use HTML 5's geolocation feature in GWT using the Geolocation API provided by the gwt-mobile-webkit project.

You'll only be able to use this on browsers that support this fairly new feature, though.

Jason Hall
+2  A: 

If I were you I would use the HTML5 geolocation API. One of the procject's that you could use is the already mentioned gwt-mobile-webkit. If you need a solution that would be of a benefit to more users you could use a revers ip lookup. Use the following link to see one of the companies that provides reverse ip lookup.

http://www.ip2location.com/

Just to say one more - if you can afford to lose some of your users, or just cripple them, go for HTML5.

markovuksanovic
A: 

A safer bet than HTML5's geolocation feature is GeoLite City from MaxMind, a free (and slitghly less accurate) version of their GeoIP City product.
They offer APIs for various languages - I'm sure you'll find one that fits your server side :)

Igor Klimer
Yeah, I was looking for this to suggest but I just couldn't remember the name. this is a really good thing.
markovuksanovic