So, I was told in my previous question that I can use the databases provided by MaxMind to determine locations.
So, I got their databases downloaded from their site. They are csv
files and open up in Excel.
InetAddress ip = InetAddress.getLocalHost()
is how I get the IP of my computer. From there I do String justIP = ip.getHostAddress()
My question is:
justIP
to a city location using the DB I just downloaded ??? One of the files has three columns. startIPNum
, endIPNum
and locID
I do not know what these do but I guess locID
maps to a city and country location in the other file.
Did you tried the Java examples from Maxmind? http://dev.maxmind.com/geoip/downloadable#Java-8
And see http://dev.maxmind.com/geoip/csv for field descriptions