diff --git a/.DS_Store b/.DS_Store index 74b86ac8..d9fbe333 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/.gitignore b/.gitignore index 13d99561..d834f808 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ -.DS_Store +git .DS_Store .idea/ .venv .venv/* +node_modules diff --git a/SDKs/android/ekascribe.mdx b/SDKs/android/ekascribe.mdx new file mode 100644 index 00000000..dde90259 --- /dev/null +++ b/SDKs/android/ekascribe.mdx @@ -0,0 +1,369 @@ +# EkaScribe SDK Documentation + +EkaScribe SDK (Voice2Rx) is an Android SDK for voice-based medical transcription and documentation. +It provides real-time voice recording, transcription, and intelligent medical documentation +generation with support for multiple languages and output formats. + +**Version:** 3.0.7 + +**Minimum Android SDK:** 23 (Android 6.0) + +--- + +## 1. Installation + +### Add Maven Repository + +Add the JitPack repository to your project's `settings.gradle.kts` (or `build.gradle`): + +```kotlin +dependencyResolutionManagement { + repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) + repositories { + google() + mavenCentral() + // Add below line to fetch SDK from Jitpack + maven { url = uri("") } + } +} + +``` + +### Add Dependencies + +Add the EkaScribe SDK and required networking dependency to your app's `build.gradle.kts`: + +```kotlin +dependencies { + implementation("com.github.eka-care:Eka-Scribe-Android:${LATEST_VERSION}") +} + +``` + +### Required Permissions + +Add the following permissions to your `AndroidManifest.xml`: + +```xml + + + +``` + +**Note:** You must request `RECORD_AUDIO` permission at runtime for Android 6.0 and above. + +--- + +## 2. Initialization + +Initialize the SDK in your `Application` class or main `Activity`. + +### Step 1: Implement Lifecycle Callbacks + +Create a class that implements `Voice2RxLifecycleCallbacks` to handle session events. + +```kotlin +import com.eka.voice2rx_sdk.sdkinit.Voice2RxLifecycleCallbacks +import com.eka.voice2rx_sdk.common.models.EkaScribeError + +class MyVoice2RxCallbacks : Voice2RxLifecycleCallbacks { + override fun onStartSession(sessionId: String) { + // Recording started + } + + override fun onStopSession(sessionId: String, recordedFiles: Int) { + // Get result when ready after stopping the session + CoroutineScope(Dispatchers.IO).launch { + Voice2Rx.pollEkaScribeResult(sessionId = sessionId).onSuccess { + Log.d(TAG, it.templates.toString()) + }.onFailure { + Log.d(TAG, "error : ${it.message.toString()}") + } + } + } + + override fun onPauseSession(sessionId: String) { + // Recording paused + } + + override fun onResumeSession(sessionId: String) { + // Recording resumed + } + + override fun onError(error: EkaScribeError) { + // Handle error + } +} + +``` + +### Step 2: Implement TokenStorage + +The networking module requires a `TokenStorage` implementation to handle authentication tokens. + +```kotlin +import com.eka.networking.token.TokenStorage + +class MyTokenStorage : TokenStorage { + override fun getAccessToken(): String { + return "access_token" + } + + override fun getRefreshToken(): String { + return "refresh_token" + } + + override fun saveTokens(accessToken: String, refreshToken: String) { + // save tokens + } + + override fun onSessionExpired() { + // SessionExpired refresh token expired + } +} +``` + +### Step 3: Configure and Initialize + +Initialize `Voice2Rx` with `Voice2RxInitConfig` and `NetworkConfig`. + +```kotlin +import com.eka.voice2rx_sdk.sdkinit.Voice2Rx +import com.eka.voice2rx_sdk.sdkinit.Voice2RxInitConfig +import com.eka.networking.client.NetworkConfig +import com.eka.networking.client.AuthConfig + +// 1. Configure Network +val networkConfig = NetworkConfig( + appId = "your-app-id", + baseUrl = "", + appVersionName = BuildConfig.VERSION_NAME, + appVersionCode = BuildConfig.VERSION_CODE, + isDebugApp = false // false in production environment, + apiCallTimeOutInSec = 30L, + headers = mapOf(), // Optional headers + tokenStorage = MyTokenStorage() +) + +// 2. Configure SDK +val config = Voice2RxInitConfig( + voice2RxLifecycle = MyVoice2RxCallbacks(), + networkConfig = networkConfig, +) + +// 3. Initialize +Voice2Rx.init(config, context) + +``` + +--- + +## 3. Core API Reference + +All main functions are available via the `Voice2Rx` singleton object. + +### Recording Control + +### `startVoice2Rx` + +Starts a new voice recording session. + +```kotlin +fun startVoice2Rx( + mode: String = Voice2RxType.CONSULTATION.value, // "consultation" or "dictation" + patientDetails: PatientDetails? = null, + outputFormats: List