Java/Kotlin
Add Dependency
Add the SDK dependency.
repositories {
mavenCentral()
}
dependencies {
implementation 'io.hackle:hackle-server-sdk:2.32.0'
}SDK Initialization
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.
You can find the SDK Key in SDK Integration Info on the Hackle Service Dashboard.
Shutdown
You must call the close() method when the application shuts down. This releases resources in use and sends any remaining events.
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