Skip to content

//sorisdk/com.iplateia.sorisdk

Package-level declarations

Types

NameSummary
Actions[androidJvm]
object Actions
Constants for the action names in broadcast intents.
APIConfig[androidJvm]
object APIConfig
Represents the configuration for the SORI API. Since SORIAudioRecognizer is considered a singleton, the configuration is stored in this object.
AuthResult[androidJvm]
data class AuthResult(val success: Boolean, val updated: Boolean, val url: String?)
Represents the result of an authentication process.
DatabaseUpdateState[androidJvm]
@Serializable
data class DatabaseUpdateState(val downloadedPath: String, val version: String, val downloadTime: Long)
Represents the state of a pending database update.
ILocationProvider[androidJvm]
interface ILocationProvider
Interface for delegate the location to be sent to the server. The location can be used to narrow down the campaign to a specific location.
IMetadataProvider[androidJvm]
interface IMetadataProvider
Interface for delegate the metadata to be sent to the server. You can implement this interface to what metadata you want to send to the server. The metadata which is sent to the server will be passed through the webhook.
ISORIListener[androidJvm]
interface ISORIListener
Interface definition for callbacks to be invoked when SORI SDK events occur.
NetworkMonitor[androidJvm]
object NetworkMonitor
Singleton network monitor that persists beyond Service lifecycle.
NetworkUnavailableException[androidJvm]
class NetworkUnavailableException(message: String, cause: Throwable? = null) : Exception
Exception thrown when a network operation cannot be completed due to network unavailability.
NetworkUtils[androidJvm]
object NetworkUtils
Utility class for checking network connectivity status.
PendingActivityRequest[androidJvm]
data class PendingActivityRequest(val materialId: String, val timestamp: Long = System.currentTimeMillis())
Data class representing a pending activity request that failed due to network unavailability.
PendingRequestManager[androidJvm]
class PendingRequestManager(apiClient: SORIApiClient, config: SORIConfig)
Manager for handling pending API requests when network connectivity is unavailable.
ServiceState[androidJvm]
object ServiceState
Constants for the service states.
SORIApiClient[androidJvm]
open class SORIApiClient(applicationId: String, secretKey: String, sessionId: String, context: Context? = null)
SORIAudioRecognitionService[androidJvm]
open class SORIAudioRecognitionService : Service
Foreground service that handles audio recognition tasks with network resilience support.
SORIAudioRecognizer[androidJvm]
open class SORIAudioRecognizer(applicationId: String, secretKey: String)
The primary entry point for the SORI SDK that handles audio recognition with network resilience.
SORIBroadcastReceiver[androidJvm]
class SORIBroadcastReceiver(listener: ISORIListener) : BroadcastReceiver
Default BroadcastReceiver for SORIAudioRecognitionService. It listens to the broadcast intents sent by the service and fires the corresponding events to the listener.
SORICampaign[androidJvm]
data class SORICampaign(val id: String, val name: String, val description: String? = null, val imageUrl: String? = null, val actionUrl: String? = null, val createdAt: Long = 0) : Parcelable
Represents a SORI campaign that found during the audio recognition process.
SORIConfig[androidJvm]
data class SORIConfig(val enableDelayedSending: Boolean = true, val maxPendingTimeMillis: Long = 10 * 60 * 1000L, val autoRetryOnNetworkRecovery: Boolean = true)
Configuration class for SORI SDK network handling and offline support behavior.
SORIListener[androidJvm]
open class SORIListener : ISORIListener
Default implementation of the ISORIListener interface with empty method bodies.
UpdateResult[androidJvm]
data class UpdateResult(val success: Boolean, val updateAvailable: Boolean, val currentVersion: String, val errorMessage: String? = null)
Represents the result of a database update operation.

Properties

NameSummary
API_ENDPOINT[androidJvm]
const val API_ENDPOINT: String
API base endpoint
DUMP_PCM[androidJvm]
const val DUMP_PCM: Boolean = false
Dump PCM data flag
json[androidJvm]
val json: Json
Shared Json instance with common configuration
TAG[androidJvm]
const val TAG: String
Log tag for the SDK
VERSION[androidJvm]
const val VERSION: String
SDK version

Functions

NameSummary
getDeviceId[androidJvm]
fun getDeviceId(context: Context): String
Create or retrive the device ID from shared preferences. If it doesn't exist, it generates a new UUID and saves it.
getPreference[androidJvm]
fun getPreference(context: Context, key: String): String?
Retrieve a string preference from shared preferences.
[androidJvm]
fun getPreference(context: Context, key: String, defaultValue: String): String
Retrieve a string preference from shared preferences with a default value.
setDeviceId[androidJvm]
fun setDeviceId(context: Context, deviceId: String)
Set the device ID manually in shared preferences.
setPreference[androidJvm]
fun setPreference(context: Context, key: String, value: Any)
Save an object preference in shared preferences. The value should be serializable using Kotlin serialization.
[androidJvm]
fun setPreference(context: Context, key: String, value: String)
Save a string preference in shared preferences.