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/" } 
        }
    }
  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:4.1.6'
     }
    kotlin
     dependencies {
         implementation("com.acme.corp:package1:2.10.1")
         implementation("com.awsome.corp:package2:3.14.159")
         implementation("com.iplateia:sorisdk:4.1.6") 
     }

    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.

Proguard Settings

If you are using Proguard, you need to add the following to your app's proguard-rules.pro file:

txt
# ...
-keep class com.iplateia.afplib.** { *; }
-keep class com.iplateia.sorisdk.** { *; }