Reputation: 3333
In GWT, is there a way to find out the user's physical location (country, state etc)?
Upvotes: 6
Views: 1864
Reputation: 20920
You can use HTML 5's geolocation feature in GWT using the Geolocation API provided by the gwt-mobile-webkit project.
edit: This feature is now included in the GWT SDK itself. See the geolocation
package.
You'll only be able to use this on browsers that support this fairly new feature, though.
Upvotes: 6
Reputation: 15321
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 :)
Upvotes: 0
Reputation: 15906
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.
Just to say one more - if you can afford to lose some of your users, or just cripple them, go for HTML5.
Upvotes: 0