简体   繁体   中英

Getting Country name By Ip Address in android

My requirement is to get country name by device Ip. Without any WEB/API calls. I googled well but I cannot conclude anything. We have good free service MaxMind but it provides CSV format as well its very huge in file size. Do we have any suggested way.? We should not use location based service like GPS/Network Provider..?

please helps me to fix this out..

You can use http://freegeoip.net/

It allows up to 10,000 queries per hour by default.

It uses json parsing you can easily implement

For ex: http://freegeoip.net/json/github.com

gives this

{"ip":"192.30.252.130","country_code":"US","country_name":"United States","region_code":"CA","region_name":"California","city":"San Francisco","zip_code":"94107","time_zone":"America/Los_Angeles","latitude":37.77,"longitude":-122.394,"metro_code":807}

with Country Code and Country Name

You can consider IPInfoDB API http://www.ipinfodb.com

It is fast API using data delivery network (DDN). It allows 2 connections per second by default.

http://api.ipinfodb.com/v3/ip-city/?key=your_api_key&ip=74.125.45.100

Check this service. it is completely free:

https://iplist.cc/api

You can use https://ipstack.com/

http://freegeoip.net/ is change to http://freegeoip.net/ is very simple and useful. Its implementation with volley in android is very easy

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM