Install the Android SDK
Add the JitPack repository
Section titled “Add the JitPack repository”The library is built by JitPack from the repository’s release tags. Add JitPack to the repositories in settings.gradle.kts:
dependencyResolutionManagement { repositories { google() mavenCentral() maven { url = uri("https://jitpack.io") } }}An older project that lists its repositories in the root build.gradle adds the same maven { url "https://jitpack.io" } line under allprojects { repositories { … } }.
Add the library
Section titled “Add the library”In your app module:
dependencies { implementation("com.github.MichalTDev:crm-android:v0.5.0")}Then sync Gradle. The library brings kotlinx-coroutines-android with it, and nothing else: its HTTP is HttpURLConnection, it reads and writes its JSON itself, and it keeps what it keeps in SharedPreferences.
Copy your app’s key from the App key card on Settings › your app › Developers › Install: app_…, or app_test_… for the test app. The steps in the Install
What it needs of your app
Section titled “What it needs of your app”- minSdk 21 or higher. The library is compiled for Java 8 bytecode, with Kotlin 1.9’s API and language version, so an app on Kotlin 1.9 or later can use it.
- The
INTERNETpermission. The library’s manifest declares it, and Gradle merges it into yours. - R8 needs no rules. The library reads its JSON without reflection.
- One process. The SDK runs in your app’s main process only:
SharedPreferencesis not shared across processes. Do not make aCrmin a second process (a:remoteservice, say). - Firebase Cloud Messaging, which stays yours, for pushes (Push).
- https. What your users install talks to
https://app.purrcrm.comover https. On Android 5.0 to 7.0 the SDK’s own connections trust Let’s Encrypt’s root, which those versions lack;httpis for a PurrCRM on your laptop only, allowed in a debug build (Network). - Play’s Install Referrer library, only if you want links to survive an install (Links). The SDK takes no dependency on it.
Versions
Section titled “Versions”The version in the dependency is a release tag (v0.5.0). The library’s CHANGELOG.md lists the releases, and each one says the oldest PurrCRM it works with. To move to a newer release, change the tag and sync.
Against an older PurrCRM, the SDK goes without what that version does not have, and the rest works as before: preferences() answers null, showMessage answers false, links work only under PurrCRM‘s own host. An older SDK against a newer PurrCRM ignores what it does not know.
Every request says which SDK sent it (android) and its version, which is how the overview’s checklist names it (“Android 0.2.0”). Your code reads the same two from the library’s constants in com.crm.sdk (see API at a glance).