Example app using the Monocle Android SDK.
This app uses the SDK the way a third-party app would: as the compiled library in app/libs/monocle.aar, rather than the SDK's source module. To add the SDK to your own app, follow the installation steps in the SDK README.
- Set your Monocle app's Publishable key as
publishable_keyinapp/src/main/res/values/strings.xml. You'll find it on the app's Settings page under API Keys in the Monocle Dashboard. - Open the project in Android Studio and run the
appconfiguration on a device or emulator.
The app asks for location permission, then runs an assessment and shows the encrypted result. Location is optional: if you deny it, the assessment runs without it.
MonocleExampleApplication.kt: sets up Monocle once, in theApplicationclass.MainActivity.kt: requests location permission and runs the assessment.AndroidManifest.xml: the permissions the SDK uses.app/build.gradle.kts: the.aarand the libraries the SDK needs.
Download monocle.aar from the latest SDK release and replace app/libs/monocle.aar.