Java/Kotlin

circle-info

Java/Kotlin SDK supports JDK 8 and above.

Add Dependency

arrow-up-right

Add the SDK dependency.

repositories {
  mavenCentral()
}

dependencies {
  implementation 'io.hackle:hackle-server-sdk:2.32.0'
}

SDK Initialization

triangle-exclamation

HackleClient is a class that provides methods for using the SDK features.

HackleClient initialization is required to use the SDK.

Instantiation

Pass the SDK Key to instantiate HackleClient. HackleClient periodically synchronizes with the Hackle server as a background task to obtain the required information.

Shutdown

You must call the close() method when the application shuts down. This releases resources in use and sends any remaining events.

triangle-exclamation

If you are using Spring Framework

The best approach is to register HackleClient as a bean. It will be managed as a single instance throughout the application lifecycle, and close() will be called automatically when the application shuts down.

If you are wrapping HackleClient

It is recommended to implement AutoClosable in your wrapping class and call HackleClient's close() when the wrapper's close() is called.

Last updated