How to obtain Geolocation in Play Scala application from IP Address


Knoldus

In this blog , I will explain how to obtain Geolocation in Play Scala application from IP address of user . You can easily fetch user’s current location or near by location by his IP address .

1) You will require API key to be able to use this feature. To get API key , just go to IPInfoDB .

2) Get user’s IP address

3) Provide the IPInfoDB’s API Key

4) Then obtain the user’s location from the following link

5) At last get the data from the Input Stream of connection

will provide you Geolocation in JSON format with all details including Latitude and Longitude.

View original post

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s