This section contains sample apps demonstrating how to integrate and use Customer.io SDK in Android projects. The sample apps provided are:
- java_layout: Java based app using XML layouts
- kotlin_compose: Kotlin based app using Jetpack Compose
To compile and run these sample apps, you'll need to set up cdpApiKey
and siteId
in samples/local.properties
file. Follow these steps:
-
In
samples
directory, create a file namedlocal.properties
-
Add the following lines to the file, replacing
cdpApiKeyValue
andsiteIdValue
with your actual keys:cdpApiKey=cdpApiKeyValue siteId=siteIdValue
- Open
customerio-android
directory in Android Studio. - Select the desired app configuration (
samples.java_layout
orsamples.kotlin_compose
) from run configuration dropdown in Android Studio. - Click the
Run
button to build and run the app on an emulator or connected device.
The sample apps currently use SDK as local module dependency (e.g., project(":datapipelines")
). If you want to use a specific version of the SDK instead, there are two options:
-
Checkout a Specific Tag: You can check out repository at the desired tag corresponding to SDK version.
-
Specify in local.properties: Alternatively, you can specify the SDK version in
samples/local.properties
file by adding the following line:sdkVersion=4.1.0
These samples are designed to give a quick start with integrating and using the SDK in Android projects. For more details on the SDK's features and capabilities, please refer to complete SDK documentation.