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.Prerequisites
- Android Studio, with JDK 17 or newer (check in Settings → Build, Execution, Deployment → Build Tools → Gradle → Gradle JDK)
- Your app’s
minSdkis 21 or higher - A backend endpoint that returns a LearnInk sign-in token — see Step 1 of the WebView setup guide
- Your org ID
- Access to github.com/LearnInkTeam/learnink-sdk
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.Build fails with 'Gradle requires JVM 17 or later'
Build fails with 'Gradle requires JVM 17 or later'
Your default JDK is too old. Either set or point Android Studio’s Gradle JDK at 17+ and run it from there.
JAVA_HOME for this command:2
Add the dependency
In your app’s settings.gradle.kts, add Then in your app module’s Sync Gradle. If it cannot resolve the dependency, you missed Step 1 or added
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.build.gradle.kts:app/build.gradle.kts
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:Not using coroutines?
Not using coroutines?
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 Two layout rules worth knowing:
LearnInkWebView directly instead of LearnInk.open:- Give the view a real size — in a
LinearLayout, useheight = 0withlayout_weight = 1so it fills the space your toolbar does not use. Awrap_contentheight 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
Reacting to events
Override only the callbacks you care about — they all have default empty implementations.Configuration reference
Using a shared repository instead
If runningpublishToMavenLocal 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():
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.