Skip to content

Integrating MimiSDK

Version Support

  • minSdk / minSdkVersion Android API Level 21
  • targetSdk / targetSdkVersion Android API Level 35
  • Kotlin 1.8.22
  • Minimum Java 1.8 required

Note

The use of PTT Hearing Tests requires an application minimum of Android API Level 23.

Gradle dependencies

To download the MSDK artifacts, add the following lines to your build.gradle files:

app/build.gradle

implementation 'io.mimi:sdk:SDK-VERSION'

local.properties

Once you have obtained your Mimi Maven partner credential, we suggest to store them inside your local.properties file or another location not added to version control.

mimiMavenUser=PORTAL_USERNAME
mimiMavenPassword=PORTAL_PASSWORD

project/build.gradle

Add the following Maven repository, which is authenticated using your partner credentials:

allprojects {
    repositories {
        google()
        mavenCentral()
        // Mimi artifacts repository
        maven {
            url "https://api.integrate.mimi.io/files/sdk/android"
            credentials {
                username = "${mimiMavenUser}"
                password = "${mimiMavenPassword}"
            }
            authentication {
                basic(BasicAuthentication)
            }
        }
    }
}

Initialization

Once you've added the MSDK dependency, your application will need to initialize the MSDK.

Client Authentication

We use a client credentials to authenticate you as a partner product with Mimi. These credentials are mandatory, and the SDK will not function without providing them.

So before continuing, make sure you have the following:

  • Client Identifier
  • Client Secret

Call MimiCore.start() in your Application class to initialize the SDK.

Note

MSDK initialization should only be performed once during the lifecycle of your app.

class MyApp: Application() {
    override fun onCreate() {
        super.onCreate()

        MimiCore.start(this,
            "MY_CLIENT_ID",
            "MY_CLIENT_SECRET")
    }
}

Like your Mimi Maven credentials, keep your client credentials in a location outside of version control.

Warning

If you have been supplied with dev and production credentials: please ensure that these credentials are used only for their corresponding application build variant.

Permissions

Make sure your AndroidManifest.xml includes the internet permissions, otherwise you won't be able to initialize our services.

<uses-permission android:name="android.permission.INTERNET" />

For Hearing Tests, you should also include permissions for connecting to Bluetooth devices.

<uses-permission
    android:name="android.permission.BLUETOOTH"
    android:maxSdkVersion="30" />
<!-- to access BluetoothDevice data (scan result for classic devices) and connect to devices. -->
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />

Your application should also provide an appropriate permissions grant flow for android.permission.BLUETOOTH_CONNECT.

Troubleshooting

For your debug builds, we recommend you enable Mimi Logging to help identify issues.

If you have further questions then please don't hesitate to get in touch with us via our Mimi Support Portal.