This demo provides an example of how to integrate the SpeechSuper Android Kotlin SDK into your Android app for pronunciation assessment. Follow these steps to get started:
- Open the file
app/src/main/java/com/example/demo_for_android_kotlin/MainActivity.kt
. - Insert your
appKey
andsecretKey
into the following lines:
private val appKey = "Insert your appKey here"
private val secretKey = "Insert your secretKey here"
- Open the file
app/src/main/java/com/example/demo_for_android_kotlin/TestActivity.kt
. - Modify the input parameters according to your needs in the following code block:
val requestObj = JSONObject() requestObj.put("coreType", coreType) requestObj.put("refText", refText) SkegnManager.getInstance(this).startSkegn(requestObj, object: SkegnManager.CallbackResult{ override fun run(response: String){ setResult(response) } });
- Run the application on your device or emulator.
- Click on the item on the screen to navigate to the evaluation screen.
- On the evaluation screen, click the "START EVAL" button to begin recording and evaluation.
- Click the "STOP EVAL" button to stop recording and await the results.
Ensure that your build.gradle
file includes NDK and sourceSets configurations as follows:
android {
...
defaultConfig {
...
ndk {
abiFilters "armeabi", "armeabi-v7a", "arm64-v8a", "x86"
}
}
...
sourceSets {
main {
jniLibs.srcDirs = ['libs']
}
}
}
dependencies {
implementation fileTree(dir: 'libs')
...
}
...
-keep class com.speechsuper.** { *; }
-keepclasseswithmembernames class * {
native <methods>;
}