use of com.pokegoapi.util.SystemTimeImpl in project PokeGOAPI-Java by Grover-c13.
the class UseIncenseExample method main.
/**
* Catches a pokemon at an area.
*/
public static void main(String[] args) {
OkHttpClient http = new OkHttpClient();
PokemonGo api = new PokemonGo(http, new SystemTimeImpl());
try {
HashProvider hasher = ExampleConstants.getHashProvider();
api.login(new PtcCredentialProvider(http, ExampleConstants.LOGIN, ExampleConstants.PASSWORD), hasher);
api.setLocation(ExampleConstants.LATITUDE, ExampleConstants.LONGITUDE, ExampleConstants.ALTITUDE);
api.inventories.itemBag.useIncense();
} catch (RequestFailedException e) {
// failed to login, invalid credentials, auth issue or server issue.
Log.e("Main", "Failed to login, captcha or server issue: ", e);
}
}
Aggregations