The Kotlin player kit runs on the JVM, on the desktop and on Android. Java games use the same kit through its Java facade. The samples follow a libGDX game, whose render loop is a natural place to drain events, and the same calls fit any game loop.
Add the kit and its natives
The kit and its native libraries are separate artifacts on Maven Central, so add both. A desktop game adds lingara-embed-natives-desktop, which carries the libraries for Windows, macOS and Linux. An Android module adds lingara-embed-natives-android, an AAR, instead. In a libGDX project, the desktop natives go in the desktop module and the Android natives in the Android module.
A Kotlin game depends on lingara-embed-kotlin; a Java game on lingara-embed-java, the facade.
Get tokens from your server
The kit never holds a secret. Give it your own server’s token route and the header that carries the player’s session, and the kit posts to it whenever it needs a token. Your server mints with a server kit and answers with the token and its expiry.
Drain events in your render loop
The core runs its network I/O on its own thread and never calls into your code. In your render loop, on the game thread, drain what has arrived, at most 256 events at a time, and handle each one: a practice update, a streamed NPC reply, an error. In Java, each event goes to the matching method of your visitor. Close the kit in your game’s dispose step, which stops the core and frees it.