Skip to content

A simple library for converting ip address to country

License

Notifications You must be signed in to change notification settings

chen0040/java-geoip

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

java-geoip

A simple library for converting ip address to country

Install

Add the following dependency to your POM file:

<dependency>
  <groupId>com.github.chen0040</groupId>
  <artifactId>java-geoip</artifactId>
  <version>1.0.1</version>
</dependency>

Usage

The sample codes below shows how to use the GeoIp class in your application:

import com.github.chen0040.geoip.GeoIp;

public class Demo {
    public static void main(String[] args) {
        GeoIp geoIp = new GeoIp();
        final String ipAddress = "13.93.122.38";
        CountryResponse country = geoIp.getCountry(ipAddress);
        System.out.pritnln("Country from which ip " + ipAddress + " comes from is " + country.getCountry().getName());
    }
}

About

A simple library for converting ip address to country

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages