Native Kotlin and Android SDK for OpenPanel, the open-source product analytics platform and Mixpanel alternative.
Add JitPack to your repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
maven("https://jitpack.io")
}
}Add the SDK dependency:
dependencies {
implementation("com.github.sonusony19.openpanel-android:openpanel-android:0.0.1")
}JitPack builds from GitHub tags, so replace 0.0.1 with the release tag you publish.
For local verification before a public release:
./gradlew :OpenPanelSDK:publishReleasePublicationToMavenLocalMinimum supported Android API level: 23.
Initialize the SDK from your Application class or another app-level startup point:
import dev.openpanel.OpenPanel
val op = OpenPanel.create(
context = applicationContext,
options = OpenPanel.Options(
clientId = "YOUR_CLIENT_ID",
clientSecret = "YOUR_CLIENT_SECRET"
)
)clientId: Required OpenPanel client ID.clientSecret: Optional client secret. Native Android integrations usually need this for authenticated event ingestion.apiUrl: Optional API URL for OpenPanel Cloud or a self-hosted instance. Defaults tohttps://api.openpanel.dev.waitForProfile: Delays event sending until a profile is identified.filter: Invoked before sending a payload. Returnfalseto drop the payload.disabled: Disables sending while keeping SDK calls safe.automaticTracking: Tracksapp_openedandapp_closedfrom Android activity lifecycle callbacks.verbose: Enables debug logging.
op.track("button_clicked", mapOf("button_id" to "submit_form"))op.identify(
"user123",
mapOf(
"firstName" to "John",
"lastName" to "Doe",
"email" to "john@example.com",
"customAttribute" to "value"
)
)op.setGlobalProperties(
mapOf(
"app_version" to "1.0.2",
"environment" to "production"
)
)op.alias("user123", "john_doe")
op.increment("user123", "login_count", 1)
op.decrement("user123", "credits", 5)
op.clear()JitPack is the primary release path for now. Create and push a GitHub release tag, then look up sonusony19/openpanel-android on JitPack to trigger the build.
The SDK module publishes a release AAR, sources JAR, javadocs JAR, and Maven POM. JitPack uses jitpack.yml to run the release publication to Maven local with Java 17.
Useful tasks:
./gradlew :OpenPanelSDK:assembleRelease
./gradlew :OpenPanelSDK:publishReleasePublicationToMavenLocal
./gradlew :OpenPanelSDK:publishReleasePublicationToLocalBuildRepositoryMaven Central metadata is kept in gradle.properties for a later Central release. The future Maven Central coordinate is:
dependencies {
implementation("io.github.sonusony19:openpanel-android:0.0.1")
}Maven Central publishing task:
./gradlew :OpenPanelSDK:publishReleasePublicationToSonatypeRepositoryMaven Central publishing expects credentials from Gradle properties or environment variables:
mavenCentralUsernameorMAVEN_CENTRAL_USERNAMEmavenCentralPasswordorMAVEN_CENTRAL_PASSWORDsigningInMemoryKeyorSIGNING_KEYsigningInMemoryKeyPasswordorSIGNING_KEY_PASSWORD
This SDK follows the repository license in LICENSE.md.