Skip to content
Mobile Joe Docs Dashboard
View Markdown

Android · Kotlin · Jetpack Compose · SDK 1.0.2

Android quickstart

Configure Mobile Joe and show a FAQ published from your dashboard.

What you need

  • An Android app built with Kotlin and Jetpack Compose: Android 8.0+ (API 26), compileSdk 35+, Android Gradle Plugin 8.6+, and Kotlin 2.1+.
  • Your app in Mobile Joe with a published FAQ. See Set up your app.
  • Its public SDK key. Set up SDK → Android shows the configuration below with your key already filled in, plus a prompt for your coding agent.

Start with an Android Studio Compose project with Material 3 and the Kotlin Compose compiler plugin enabled.

Install the SDK

In settings.gradle.kts, include these dependency repositories:

dependencyResolutionManagement {
    repositories {
        google()
        mavenCentral()
    }
}

Add this to app/build.gradle.kts:

dependencies {
    implementation("dev.mobilejoe:mobilejoe-ui-compose:1.0.2")
}

The Compose module includes dev.mobilejoe:mobilejoe-api transitively. For a custom UI, depend on it alone. A working sample is in the Android repository.

Configure your app

In app/src/main/java/your/package/MyApplication.kt, retain your package declaration and add configuration to your existing Application class. Replace YOUR_API_KEY with the public SDK key of your app in Mobile Joe.

import android.app.Application
import dev.mobilejoe.api.Joe

class MyApplication : Application() {
    override fun onCreate() {
        super.onCreate()

        Joe.configure(
            applicationContext = this,
            apiKey = "YOUR_API_KEY",
        )
    }
}

Merge the following into app/src/main/AndroidManifest.xml, using your actual Application class name. Keep existing activities and application attributes.

<manifest xmlns:android="http://schemas.android.com/apk/res/android">
    <application android:name=".MyApplication">
        <!-- Keep your existing activities and other application settings. -->
    </application>
</manifest>

Call Joe.configure directly in Application.onCreate, without a coroutine. It returns right away and registers the device in the background. In a coroutine, a component can load first and miss its content, such as an active alert at a cold start.

Check your connection

Run your app and keep App Settings → Set up SDK → Android open in the dashboard. The indicator confirms a registered Android device of this app. An earlier registration can also confirm it, so verify current content next.

Show your FAQs

Publish a recognizable FAQ in your app in Mobile Joe. Adapt MainActivity.kt below, keeping your package declaration, theme and existing navigation. Replace the support address.

import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.material3.MaterialTheme
import dev.mobilejoe.ui.compose.faq.FaqHost
import dev.mobilejoe.ui.compose.faq.FaqUiConfiguration

class MainActivity : ComponentActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContent {
            MaterialTheme {
                FaqHost(
                    configuration = FaqUiConfiguration(
                        context = this,
                        recipient = "support@example.com",
                    ),
                )
            }
        }
    }
}

Open the FAQ and check its answer. Edit it in the dashboard and pull to refresh to see the update. See the FAQ guide for more options.

Before you ship

For signed-in users, pass a stable account ID as appUserId to Joe.configure or call Joe.identify(appUserId) after sign-in, and Joe.logout() after sign-out; see Identity and data. The SDK captures your app's languages during configuration, so configure after selecting the app language. Disable debug mode in release builds.

Troubleshooting

If the dependency cannot resolve, check mavenCentral() and the exact version. The SDK needs JDK 17 and JVM target 17 or later. For a missing connection or FAQ, filter Logcat for the tag Joe and follow Troubleshooting.

Next steps

Add Feature Plans, FAQs, or Alerts.