Skip to main content
Beta — installed from GitHub. During the beta you build the SDK locally once, then depend on it like any other library. When we publish to Maven Central the only change will be removing mavenLocal() and the build step. See Overview.
By the end of this guide, tapping a button in your app opens LearnInk with the user already signed in.

Prerequisites

1

Build the SDK on your machine

Clone the repository somewhere outside your app project, check out the beta tag, and publish the SDK to your local Maven repository:
You should see BUILD SUCCESSFUL. This places the SDK in ~/.m2/repository/ink/learn/, where Gradle can find it.
Every developer on your team must run this once, and so must your CI runner. It is the main inconvenience of the beta and it disappears when we publish to Maven Central. If your CI cannot clone the repository, see Using a shared repository instead below.
Your default JDK is too old. Either set JAVA_HOME for this command:
or point Android Studio’s Gradle JDK at 17+ and run it from there.
2

Add the dependency

In your app’s settings.gradle.kts, add mavenLocal() to the repositories block:
settings.gradle.kts
If your project uses the older style with allprojects { repositories { … } } in the root build.gradle, add mavenLocal() there instead.
Then in your app module’s build.gradle.kts:
app/build.gradle.kts
Sync Gradle. If it cannot resolve the dependency, you missed Step 1 or added mavenLocal() in the wrong place — see Troubleshooting.
3

Check your permissions

The SDK declares the permissions it needs (INTERNET and ACCESS_NETWORK_STATE) in its own manifest, and Android merges them into your app automatically. You do not need to add anything.ACCESS_NETWORK_STATE is used only to detect whether the device is online, so the SDK can show downloaded content immediately instead of waiting for a network request that cannot succeed.
4

Configure the SDK once, at startup

Tell the SDK your org ID and how to get a token. Do this once — in your Application class, or right after your own login completes:
fetchLearnInkToken() is your function that calls your backend. Here is a complete example using OkHttp — adapt it to whatever HTTP client your app already uses:
Never call the LearnInk Identify API directly from your app. That would put your API key on user devices, where it can be extracted. Your app calls your backend; your backend holds the key. The SDK is built around this and gives you no way to do otherwise.
Implement TokenProvider directly and call the callback from whatever async mechanism you use. Call it exactly once:
5

Open LearnInk

The simplest integration is one line. This opens a full-screen LearnInk experience that handles loading, closing, back navigation and session refresh for you:
path is the section to open — "learning" is the main training area.That is a complete integration. If that is all you need, skip to Step 7.
6

Optional — embed it in your own screen

If you want LearnInk inside your own layout (under a toolbar, in a tab, in a bottom sheet), use LearnInkWebView directly instead of LearnInk.open:
Always call destroy() in onDestroy() (or onDestroyView() for a Fragment). Forgetting this leaks the WebView.
Two layout rules worth knowing:
  • Give the view a real size — in a LinearLayout, use height = 0 with layout_weight = 1 so it fills the space your toolbar does not use. A wrap_content height renders nothing.
  • Position it clear of the system bars yourself. The SDK does not apply window insets, because only your app knows where the view sits in your layout.
7

Verify it works

Run your app and open LearnInk. You should see:
  • ✅ A brief loading indicator, then LearnInk content
  • ✅ No login screen — the user is signed in automatically
  • ✅ Tapping the close button inside LearnInk dismisses the screen
If you see a login screen, the token did not reach LearnInk. That is the most common first-run problem and it is almost always the backend endpoint — see Troubleshooting.

Reacting to events

Override only the callbacks you care about — they all have default empty implementations.

Configuration reference

Using a shared repository instead

If running publishToMavenLocal on every machine and CI runner is impractical, publish the SDK once to a Maven repository your team already has (Artifactory, Nexus, or a static bucket), and point your app at that instead of mavenLocal():
Email support@learn.ink if you would like help with this.

Next steps

Offline behaviour

What your app must show when a user has no connection and nothing downloaded.

Push notifications

Still required — the SDK does not change how notifications reach users.