Skip to Content
PlatformsAndroid

Android SDK

Use the ANVISA Android SDK to integrate the locked ANVISA measurement and calibration flow into a native Android app.

Installing the SDK package

Download the Shen.AI AAR package (shenai_sdk.aar) and add it to your project as a dependency in build.gradle.

dependencies { implementation files('./path/to/your/shenai_sdk.aar') }

See the Customer Portal for SDK downloads.

Needed permissions

Shen.AI (ANVISA) needs camera access for video measurement and Internet access for license validation.

<uses-permission android:name="android.permission.CAMERA" /> <uses-feature android:name="android.hardware.camera" android:required="true" /> <uses-permission android:name="android.permission.INTERNET"/>

App components

Initialize the SDK from an Android Activity and use ShenAIView to display the embedded SDK UI.

import ai.mxlabs.shenai_sdk.ShenAIAndroidSDK import ai.mxlabs.shenai_sdk.ShenAIView private val shenaiSDKHandler = ShenAIAndroidSDK() val initResult = shenaiSDKHandler.initialize(this, API_KEY, USER_ID) val shenaiView = ShenAIView(this) setContentView(shenaiView)

The Activity passed to ShenAIView should be a LifecycleOwner so the view can release resources when the activity is paused.

Further steps

See Initialization, Configuration, and Measurement preparation for the supported Shen.AI (ANVISA) flow.