This page describes how to install the Shake SDK into your Android application via Gradle. Whether you are using Java or Kotlin, you can follow the steps below.
Add Maven repository to your top-level build.gradle file
Add Shake dependency to your app-level build.gradle file
Add Client ID and Secret to AndroidManifest.xml as metadata
Open your AndroidManifest.xml file. Paste this but replace
your-api-client-secret with the actual values you have in your workspace settings.
Caveat for apps targeting SDK version 28 and lower
The Shake SDK targets the latest Android version(API 29) and as such has the attribute
android:foregroundServiceType="mediaProjection" defined in the manifest that the screen recording feature requires. If your app
targetSdkVersion is 28 or lower(defined in your projects
build.gradle) you have to add the service definition to your manifest file manually otherwise the build won't pass. Open your AndroidManifest.xml file and paste this:
If you target Android API 28 and lower and don't add this service definition to your manifest you will get the following error:
Now build your project and see everything work! To build and run your app, select Run › Run in the menu bar. This first run will automatically add your app to your Shake Dashboard based on your app bundle ID.