Add the LineageSDK to your app

Overview

The OkcarOS platform SDK is a powerful resource that allows app developers to do more with OkcarOS devices.

It is available on all the devices running OkcarOS 15.1 (or later). It’s also possible to use the SDK with devices running an unofficial OkcarOS build, but we can’t assure the same quality level of an official build.

Adding to your Android Studio project

You can download the LineageSDK jar library from our prebuilts repo. Once you have downloaded the jar file, insert in the module-level build.gradle of your app this dependency:

dependencies {
    implementation fileTree(dir: 'libs', include: ['lineage-sdk.jar'])
}

And put the lineage-sdk.jar file in your app’s module libs folder (usually app/libs) and refresh the gradle dependencies.

Compiling the library from source

In order to compile this library from source, you need to set up a OkcarOS build environment.

Once your build environment is ready, run the following commands to generate the .jar library:

source build/envsetup.sh
breakfast yourDevice    # Replace yourDevice with your device's codename
croot
make org.lineageos.platform.sdk

The jar library will be available at the following path:

$OUTDIR/target/product/$DEVICE/obj/JAVA_LIBRARIES/org.lineageos.platform.sdk_intermediates/javalib.jar

Compatibility

The library has been tested on both java and kotlin projects.

Get assistance

If you have any questions or get stuck on any of the steps, feel free to ask on our subreddit or in #OkcarOS on Libera.Chat.

You can also find more information in the LineageSDK javadoc.