Skip to content

Dramwise SDK Integration Guide

Maven Central Version

Follow these steps to integrate the Dramwise SDK into your Android application.

1. Add the Dependency

Add the Dramwise SDK dependency to your app's build.gradle.kts file.

dependencies {
    implementation("am.dramwise:sdk:latestVersion")
}

Add the following to your libs.versions.toml file:

[versions]
dramwiseSdk = "latestVersion"

[libraries]
dramwise-sdk = { group = "am.dramwise", name = "sdk", version.ref = "dramwiseSdk" }

Then, add the dependency in your build.gradle.kts file:

dependencies {
    implementation(libs.dramwise.sdk)
}

2. Initialize the SDK

In your Application class, initialize the SDK in the onCreate method:

import android.app.Application
import am.dramwise.sdk.DramwiseSdk

class MyApplication : Application() {
    override fun onCreate() {
        super.onCreate()
        DramwiseSdk.initialize(this, "YOUR-API-KEY")
    }
}
Remember to register your MyApplication class in the AndroidManifest.xml file.

<application
    android:name=".MyApplication"
    ...>
    ...
</application>

3. Use the DramwiseScreen Composable

You can now use the DramwiseScreen composable in your app. Pass a list of BasicTransaction objects to it.

import androidx.compose.runtime.Composable
import am.dramwise.sdk.ui.DramwiseScreen
import am.dramwise.sdk.data.models.BasicTransaction

@Composable
fun MyScreen() {
    val transactions: List<BasicTransaction> = // Your list of transactions
    DramwiseScreen(transactions = transactions)
}

That's it! You have successfully integrated the Dramwise SDK.