Android
Steps
1
2
Initialize the SDK
package com.example.myapp
import android.app.Application
import android.util.Log
import com.sentiance.sdk.Sentiance
class MyApplication: Application() {
override fun onCreate() {
super.onCreate()
val options = SentianceOptions.Builder(this).build()
Sentiance.getInstance(this).initializeAsync(options)
.addOnCompleteListener { operation ->
if (operation.isSuccessful) {
Log.d(TAG, "Initialization succeeded");
} else {
val reason = operation.error.failureReason.name
val throwable = operation.error.throwable
Log.e(TAG, "Intialization failed with reason ${reason}", throwable);
}
}
}
companion object {
private const val TAG = "Sentiance SDK"
}
}3
Last updated