Skip to content

Installation

From the scratch

We provide a sample code that demonstrates how to integrate the SDK into your Android app.

SORI Example Android Kotlin

Check out the example app and test how it works.

Integrate into existing project

  1. Add the maven repository to your project's root settings.gradle file:

    groovy
    // ... omit ...
    dependencyResolutionManagement {
        repositories {
            maven { url "https://maven.iplateia.com/sorisdk/" } 
        }
    }
    kotlin
    // ... omit ...
    dependencyResolutionManagement {
        repositories {
            maven("https://maven.iplateia.com/sorisdk/") 
        }
    }
  2. And add the following to your app's app/build.gradle file:

    groovy
     dependencies {
         implementation 'com.acme.corp:package1:2.10.1'
         implementation 'com.awsome.corp:package2:3.14.159'
         implementation 'com.iplateia:sorisdk:5.0.0'
     }
    kotlin
     dependencies {
         implementation("com.acme.corp:package1:2.10.1")
         implementation("com.awsome.corp:package2:3.14.159")
         implementation("com.iplateia:sorisdk:5.0.0") 
     }

    Version

    Use the latest 5.0.0 package for new integrations. Existing applications on 4.3.x can upgrade without changing the basic start and stop flow.

    That's it! You can now use the SORI SDK in your Android project.

AndroidManifest.xml Settings

SORI Android SDK requires some permissions and services to be declared in your app's AndroidManifest.xml file.

For record audio, android.permission.RECORD_AUDIO permission is required. This permission is required to record audio from the microphone.

For manipulating target audio materials and sync with user's device, android.permission.INTERNET permission is required.

For foreground service, android.permission.FOREGROUND_SERVICE permission is required. Since Android 8.0 (API level 26), all services that perform long-running operation like audio recognition must be started as foreground services. This permission is required to start a foreground service. Also, after API level 33, android.permission.POST_NOTIFICATIONS permission is required to show notifications for foreground services.

Add the following to your app's AndroidManifest.xml file:

xml
<manifest ...>
    <!-- required android permissions -->
    <uses-permission android:name="android.permission.INTERNET" /> 
    <uses-permission android:name="android.permission.RECORD_AUDIO" /> 
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE" /> 
    <!-- Only required after Android 33 tiramisu -->
    <uses-permission android:name="android.permission.POST_NOTIFICATIONS" /> 

Register the audio recognition services in your app's AndroidManifest.xml file:

xml
    <application ...>
        <!-- ... -->
        <service
            android:name="com.iplateia.sorisdk.SORIAudioRecognitionService"
            android:exported="false"
            android:foregroundServiceType="microphone" />
    </application>
</manifest>

Now you are ready to use the SDK. Next step is to Implementation.

R8 and ProGuard Settings

When you install the SDK from the Maven repository, the required consumer R8 and ProGuard rules are included in the SDK package. Most applications do not need to add extra keep rules.

If your build uses a custom packaging flow instead of the Maven artifact, make sure the SDK consumer rules are preserved.