To test your mParticle local sample app:
To integrate a kit to a local sample app project:
Navigate to the app/libs folder using command cd app/libs
(you can use the Tab key to autocomplete the path).
git clone
kit-repo-url.cd
kit-name or use the Tab key to add the path name to the kit repository name.git checkout
branch-name or git checkout -b
new-branch-name.build.gradle.kts
file: implementation(project(":mparticle-android-integration-*replace-with-kit-name*"))
.settings.gradle
file:include ':mparticle-android-integration-
replace-with-kit-name
project(':mparticle-android-integration-*replace-with-kit-name*').projectDir = new File('app/libs/mparticle-android-integration-
replace-with-kit-name).cdHiggsShopSampleApplication()
, replacing .credentials(*your-apiKey,*your-apiSecret*)
.You can now test your kit integration. Place a breakpoint inside the kit’s onCreate()
and run the app in debug mode. If the kit is integrated, the breakpoint should trigger, indicating the kit is being initialized.
Due to the complexity of the multi-module configuration of the SDK, adding it directly as an operable module in the sample app is not currently supported. Different steps must be taken to build the SDK locally and add it as a dependency.
./gradlew publishReleaseLocal
. This command creates a local snapshot of the SDK.build.gradle.kts
file, replace the original core implementation with yours. You can find the name in your local m2 folder. The dependency should contain the word “SNAPSHOT.” The complete dependency should be similar to the following: implementation("com.mparticle:android-core:#.##.#-SNAPSHOT"
.You can now test your changes locally.
Was this page helpful?