dhiogoboza / rastreio-java

A Java library for tracking Correios' shipments.

Home Page:https://rubenochiavone.github.io/rastreio-java

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

rastreio-java

Build status Coverage report

A Java library for tracking Correios' shipments. Heavily inspired by https://github.com/talesluna/rastrojs.

Installation

Gradle

implementation 'java.rastreio:rastreio:1.1.0'

Maven

<dependency>
  <groupId>java.rastreio</groupId>
  <artifactId>rastreio</artifactId>
  <version>1.1.0</version>
  <type>pom</type>
</dependency>

Ivy

<dependency org='java.rastreio' name='rastreio' rev='1.1.0'>
  <artifact name='rastreio' ext='pom' ></artifact>
</dependency>

Usage

Track object async:

Rastreio.track("JT124720455BR", new Rastreio.Listener() {
  @Override
  public void onSuccess(TrackObject trackObject) {
    // Use this tracking object
  }
   
  @Override
  public void onFailure(Exception e) {
    // Report exception
    e.printStackTrace();
  }
});

Track object sync:

try {
  TrackObject trackObject = Rastreio.trackSync("JT124720455BR");

  // Use this tracking object
} catch (IOException e) {
  // Report exception
  e.printStackTrace();
}

Docs

Check documentation at https://rubenochiavone.github.io/rastreio-java.

License

Apache License 2.0. See LICENSE.md.

About

A Java library for tracking Correios' shipments.

https://rubenochiavone.github.io/rastreio-java

License:Apache License 2.0


Languages

Language:Java 58.5%Language:HTML 41.5%