Skip to content

Commit 6495ff3

Browse files
authored
docs: Created ONBOARDING.md doc with instructions on local kit and core integration in the sample app. (#117)
1 parent 2089f6c commit 6495ff3

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Adding a kit to a local mParticle sample app project
2+
3+
Use these quick, step-by-step instructions to integrate a kit to a local sample app project:
4+
5+
1. Navigate to the app/libs folder using command `cd app/libs` (you can use the Tab key to autocomplete the path).
6+
7+
* path should be similar to: *..\mparticle-android-sample-apps\core-sdk-samples\higgs-shop-sample-app\app\libs*
8+
9+
2. Clone the git repository using the command `git clone` *kit repo url*
10+
11+
3. Navigate to the repository folder using the command `cd` *kit name* or use the Tab key, path name should now have the kit repository name.
12+
13+
4. Check out a branch or create a new one using the command `git checkout` *branch name* or `git checkout -b` *new branch name*
14+
15+
5. Add the kit implementation to the app's *module-level build.gradle.kts file*: `implementation(project(":mparticle-android-integration-*replace with kit name*"))`
16+
17+
6. Include the kit in the project-level `settings.gradle` file:
18+
`include ':mparticle-android-integration-`*replace with kit name*
19+
`project(':mparticle-android-integration-*replace with kit name*').projectDir = new File('app/libs/mparticle-android-integration-`*replace with kit name*)
20+
21+
7. Finally, add the sample app credentials on the main class cdHiggsShopSampleApplication() replacing .credentials(*your apiKey,*your apiSecret*)
22+
23+
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.
24+
25+
# Adding the SDK to a local mParticle sample app project.
26+
27+
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.*
28+
29+
1. Fork a local copy of the SDK repository. In this local copy you must make *all the configuration changes that you wish to see implemented on your local sample app* before you make a local build.
30+
31+
2. After your changes are made, run the command `./gradlew publishReleaseLocal`. This command creates a local snapshot of the SDK.
32+
33+
3. Finally, in the sample app's *module-level 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"`.

core-sdk-samples/higgs-shop-sample-app/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,10 @@ To verify that your events have arrived at mParticle's servers, or to compare yo
101101

102102
This will not only show your data as it enters mParticle, but also as your data is forwarded to our various partner services and integrations (if enabled).
103103

104+
### Integrating kits and core SDK locally in the sample app
105+
106+
For information on how to integrate a kit or the core SDK for local configurations refer to [ONBOARDING.md](./ONBOARDING.md)
107+
104108
## Development Notes
105109

106110
This project is built in Kotlin and follows MVVM design patterns and uses Retrofit (networking), Room (ORM/database), and Glide (image loading)

0 commit comments

Comments
 (0)