• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

Get user's location from IP address

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, there

I'm developing a location based service app. One function is to provide local information based on user's current area.

My question is :

How to get user's location with user's IP address? Any Java APIs ?


Kevin Z
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You're in luck - an article in the JavaRanch Journal covered this.
 
Kevin Zhang
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ulf Dittmer wrote:You're in luck - an article in the JavaRanch Journal covered this.



Thanks, Ulf

I found the free solution is like "IP to country". What I really want is "IP to city".

For example, I want to tell the user is from NY according to his/her IP address.

BTW, Is there any vendor solution for this issue?

kevin

 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Kevin Zhang wrote:
BTW, Is there any vendor solution for this issue?



Check out http://www.ip2location.com.
 
Marshal
Posts: 80775
489
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Maneesh Godbole wrote:

Kevin Zhang wrote:
BTW, Is there any vendor solution for this issue?



Check out http://www.ip2location.com.

It's only got my location wrong by 200 miles!
 
Sheriff
Posts: 22854
132
Eclipse IDE Spring Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's got my location wrong by an hour drive. Well, at least it got the country right
 
Bartender
Posts: 612
7
Mac OS X Python
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
mine was only 326 miles away.
 
Sheriff
Posts: 28414
102
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When I tried one of those databases it got my country right, but it was still three time zones and around 5,000 kilometres off.
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The city was correct for me.
 
Campbell Ritchie
Marshal
Posts: 80775
489
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Mine varies; sometimes it is only 100 miles out. Always in the same general direction, so far.
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You want accuracy, you have to use the pay services. The free databases simply aren't as good.
 
Rancher
Posts: 4804
7
Mac OS X VI Editor Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Even the pay services have limits. Especially in corporate environments. I worked at a company with offices in Dusseldorf Germany that had IP addresses (and networking) from the US. using the IP would have you be off by five or six time zones and an eight hour flight.

Its like phone numbers. In the olden days, you could use the area code and exchange to identify North American phone numbers to within 10 miles. Now, people keep their cell phone numbers, and you can't tell anything. Perhaps you can tell country or continent, but you can't tell much else.
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi visit http://www.ip-details.com/ip-search/ here if you give the Ip address you can get the details about the location of that particular IP address like the country name ,ip location address,Latitude, Longitude etc...
i hope it will be helpful to you..........
 
author
Posts: 23959
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

priya uma wrote:Hi visit http://www.ip-details.com/ip-search/ here if you give the Ip address you can get the details about the location of that particular IP address like the country name ,ip location address,Latitude, Longitude etc...
i hope it will be helpful to you..........



Being from NYC, most IP locators seems to get it right. I guess cities, especially famous ones, get the data online first. So far, the bad ones report the location as New York City. And the good ones get it closer to the borough of Queens, locating to either Jamaica or Richmond Hill, which I guess, is close enough (only a few miles off).

This one however, put my location as Herndon Virginia, to the exact address of the headquarters of my cable provider. This address is more than 250 miles away, definitely not in New York City, definitely not in New York State, but got the country right.

Henry

 
Pat Farrell
Rancher
Posts: 4804
7
Mac OS X VI Editor Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Henry Wong wrote:put my location as Herndon Virginia, to the exact address of the headquarters of my cable provider.



And without knowing which is your provider, I can be sure that its not really in Herndon VA either. Herndon was a small farming market town when I was a kid. There are office buildings with many corporate HQ there now, but its really just the only post office on the 10+ lane freeway out to Dulles Airport.

Most of the big Internet companies are actually between Herndon and the airport. There is no real name, because in 2000, it was just farmland. That is where AOL built their huge headquarters and where MCI built a monster datacenter. Its also where Equinix has its series of monster co-lo facilities, which host servers for minor companies like Amazon, Yahoo, etc. Sometimes this area is labeled as "Ashburn" but its really nameless.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic