This library contains Combustible's bindings for the Lemmy API.
It consists of three main components:
- Auto-generated classes from
lemmy-js-client
. Connection
: A class that uses OkHttp and Moshi to simplify connecting to and interacting with Lemmy instances.Pictrs
: Similar toConnection
, but for Lemmy Pictrs instances.
This library can be downloaded from GitHub Packages.
Connection connection = new Connection();
GetSite method = new GetSite();
connection.send(method, getSiteResponse -> {
// Success
}, () -> {
// Error
});
By default, all callbacks are executed on a new thread. This can be changed using the Connection.setCallbackHelper
API.
For instance, if you want every callback to run on Android's UI thread, you could do:
connection.setCallbackHelper(action -> {
activity.runOnUiThread(action);
});
Combustible also generates an OpenAPI document that can be downloaded here. This document can be viewed in Swagger UI here.