0

I need some help regarding the Google Geo location.

My requirement is to write an standalone Java class to get the IP Address and the location of this IP using google API.

I mean I need to send this IP address to the google and get the location.

Can anyone please give some suggestion How can I achieve ?

Note: I dont want to use maxmind api. Is there any other open API through which I can achieve this.

Please give some idea, how to figure it out.

m.aibin
  • 3,528
  • 4
  • 28
  • 47
Sachi-17
  • 499
  • 4
  • 12
  • 29

1 Answers1

1

Normally, you can use following to get the client’s IP address that’s accessing your Java web application.

String ipAddress = request.getRemoteAddr();

If the client will use proxy, you better use solution from here: Get client ip from HttpServer

You can find a lot of other resources how to do it in Java (for example using sockets).

For geolocating IP address you can use for example this API: http://freegeoip.net/

Community
  • 1
  • 1
m.aibin
  • 3,528
  • 4
  • 28
  • 47
  • If I get the IP address the priority is How to get the Location from googlee API using JAVA. geocoding xample you have given is it a Java project ? – Sachi-17 Jan 06 '16 at 06:50
  • Read more, you will not get finished Java project, you need to try to work a little on your own. I just gave you the initial steps. Click on link and read docs. – m.aibin Jan 06 '16 at 06:54