### Testing Frameworks and Utilities (Kotlin) Source: https://context7.com/terrakok/kmp-awesome/llms.txt Includes test frameworks like Kotest and flow testing tools like Turbine for KMP projects. Requires `kotest-framework-engine` and `turbine` dependencies. ```kotlin // Kotest - Test Framework // Add dependency: io.kotest:kotest-framework-engine import io.kotest.core.spec.style.StringSpec import io.kotest.matchers.shouldBe class MyTest : StringSpec({ "string length should be correct" { "hello".length shouldBe 5 } }) // Turbine - Flow Testing // Add dependency: app.cash.turbine:turbine import app.cash.turbine.test myFlow.test { assertEquals("first", awaitItem()) assertEquals("second", awaitItem()) awaitComplete() } ``` -------------------------------- ### Logging Utilities (Kotlin) Source: https://context7.com/terrakok/kmp-awesome/llms.txt Provides multiplatform logging capabilities that output to platform-specific systems. Libraries like Napier and Kermit are used. ```kotlin // Napier - Logger // Add dependency: io.github.aakira:napier import io.github.aakira.napier.Napier Napier.d("Debug message") Napier.e("Error message", throwable) // Kermit - Logger // Add dependency: co.touchlab:kermit import co.touchlab.kermit.Logger Logger.d { "Debug message" } Logger.e(throwable) { "Error occurred" } ``` -------------------------------- ### Koin Lightweight Dependency Injection Source: https://context7.com/terrakok/kmp-awesome/llms.txt A lightweight dependency injection framework for Kotlin, supporting multiplatform development. It simplifies managing dependencies within your application. The required dependency is `io.insert-koin:koin-core`. ```kotlin import org.koin.core.context.startKoin import org.koin.dsl.module val appModule = module { single { UserRepository() } factory { UserViewModel(get()) } } startKoin { modules(appModule) } ``` -------------------------------- ### Ktor HTTP Client and Ktorfit API Definitions Source: https://context7.com/terrakok/kmp-awesome/llms.txt Libraries for making HTTP requests and defining API endpoints in Kotlin Multiplatform. Ktor provides a multiplatform HTTP client, while Ktorfit offers a Retrofit-style approach for API definitions. Dependencies include `ktor-client-core` and `de.jensklingenberg.ktorfit:ktorfit-lib`. ```kotlin import io.ktor.client.* import io.ktor.client.request.* import io.ktor.client.statement.* val client = HttpClient() val response: HttpResponse = client.get("https://api.example.com/data") println(response.bodyAsText()) // Ktorfit - Retrofit-style API definitions // Add dependency: de.jensklingenberg.ktorfit:ktorfit-lib @GET("users/{id}") suspend fun getUser(@Path("id") userId: String): User ``` -------------------------------- ### Multiplatform-Settings Key-Value Storage Source: https://context7.com/terrakok/kmp-awesome/llms.txt A key-value storage solution for Kotlin Multiplatform projects, enabling persistent data storage across different platforms. The primary dependency is `com.russhwolf:multiplatform-settings`. ```kotlin import com.russhwolf.settings.Settings val settings: Settings = Settings() settings.putString("username", "john_doe") val username = settings.getString("username", defaultValue = "") ``` -------------------------------- ### Date-Time and Async Utilities (Kotlin) Source: https://context7.com/terrakok/kmp-awesome/llms.txt Handles date/time operations and asynchronous programming using coroutines. Requires adding `kotlinx-datetime` and `kotlinx-coroutines-core` dependencies. ```kotlin // kotlinx-datetime // Add dependency: org.jetbrains.kotlinx:kotlinx-datetime import kotlinx.datetime.* val now = Clock.System.now() val localDate = now.toLocalDateTime(TimeZone.currentSystemDefault()) // kotlinx.coroutines // Add dependency: org.jetbrains.kotlinx:kotlinx-coroutines-core import kotlinx.coroutines.* import kotlinx.coroutines.flow.* val flow = flow { emit(1) delay(100) emit(2) } ``` -------------------------------- ### Kamel Image Loading for Compose Multiplatform Source: https://context7.com/terrakok/kmp-awesome/llms.txt A library for loading images asynchronously in Compose Multiplatform applications, supporting various sources like URLs. The dependency is `media.kamel:kamel-image`. ```kotlin import io.kamel.image.KamelImage import io.kamel.image.asyncPainterResource @Composable fun ProfileImage(url: String) { KamelImage( resource = asyncPainterResource(url), contentDescription = "Profile" ) } ``` -------------------------------- ### Calf Adaptive UI Components Source: https://context7.com/terrakok/kmp-awesome/llms.txt Provides adaptive UI components for Compose Multiplatform, ensuring consistent user experiences across different platforms. The dependency is `com.mohamedrejeb.calf:calf-ui`. ```kotlin import com.mohamedrejeb.calf.ui.dialog.AdaptiveAlertDialog ``` -------------------------------- ### SQLDelight Type-Safe SQL Database Source: https://context7.com/terrakok/kmp-awesome/llms.txt A library for creating type-safe SQL databases in Kotlin Multiplatform projects. It generates Kotlin APIs from SQL schema definitions, simplifying database interactions. The core dependency is `com.squareup.sqldelight:runtime`. ```kotlin // Define schema in .sq files, generates type-safe Kotlin APIs CREATE TABLE User ( id INTEGER PRIMARY KEY, name TEXT NOT NULL ); selectAll: SELECT * FROM User; ``` -------------------------------- ### Voyager Multiplatform Navigation Source: https://context7.com/terrakok/kmp-awesome/llms.txt A navigation library for Compose Multiplatform, simplifying screen transitions and management within your application. It requires the `cafe.adriel.voyager:voyager-navigator` dependency. ```kotlin import cafe.adriel.voyager.navigator.Navigator @Composable fun App() { Navigator(HomeScreen()) } ``` -------------------------------- ### MVIKotlin MVI Pattern Implementation Source: https://context7.com/terrakok/kmp-awesome/llms.txt An implementation of the Model-View-Intent (MVI) architectural pattern for Kotlin Multiplatform, promoting unidirectional data flow. The dependency is `com.arkivanov.mvikotlin:mvikotlin`. ```kotlin interface Store { val state: State fun accept(intent: Intent) } ``` -------------------------------- ### Decompose Navigation and Componentization Source: https://context7.com/terrakok/kmp-awesome/llms.txt A library for navigation and componentization in Kotlin Multiplatform applications, facilitating structured UI development. It requires the `com.arkivanov.decompose:decompose` dependency. ```kotlin import com.arkivanov.decompose.ComponentContext class RootComponent(componentContext: ComponentContext) : ComponentContext by componentContext { private val navigation = StackNavigation() val stack = childStack( source = navigation, initialConfiguration = Config.Home, childFactory = ::createChild ) } ``` -------------------------------- ### Service SDK Integrations (Kotlin) Source: https://context7.com/terrakok/kmp-awesome/llms.txt Integrates with third-party services like Firebase and Supabase using their respective Kotlin SDKs. Requires specific dependencies for each service. ```kotlin // Firebase Kotlin SDK // Add dependency: dev.gitlive:firebase-auth import dev.gitlive.firebase.auth.FirebaseAuth val auth = FirebaseAuth() val result = auth.signInWithEmailAndPassword(email, password) // Supabase-kt // Add dependency: io.github.jan-tennert.supabase:supabase-kt val client = createSupabaseClient( supabaseUrl = "YOUR_URL", supabaseKey = "YOUR_KEY" ) ``` -------------------------------- ### Cryptography Operations (Kotlin) Source: https://context7.com/terrakok/kmp-awesome/llms.txt Provides encryption, hashing, and secure random number generation. Uses libraries like `cryptography-core` and `sha2`. ```kotlin // Cryptography-Kotlin // Add dependency: dev.whyoleg.cryptography:cryptography-core import dev.whyoleg.cryptography.* val provider = CryptographyProvider.Default val sha256 = provider.get(SHA256) val hash = sha256.hasher().hash("data".encodeToByteArray()) // KotlinCrypto/hash // Add dependency: org.kotlincrypto.hash:sha2 import org.kotlincrypto.hash.sha2.SHA256 val digest = SHA256().digest("message".encodeToByteArray()) ``` -------------------------------- ### kotlinx.serialization JSON Serialization Source: https://context7.com/terrakok/kmp-awesome/llms.txt A library for efficient JSON serialization and deserialization in Kotlin, including multiplatform support. It allows easy conversion between Kotlin objects and JSON strings. The dependency is `org.jetbrains.kotlinx:kotlinx-serialization-json`. ```kotlin import kotlinx.serialization.* import kotlinx.serialization.json.* @Serializable data class User(val name: String, val age: Int) val json = Json.encodeToString(User("John", 30)) val user = Json.decodeFromString(json) ``` -------------------------------- ### Kodein Dependency Injection Container Source: https://context7.com/terrakok/kmp-awesome/llms.txt A dependency injection container for Kotlin, offering a flexible way to manage dependencies across your projects. The core dependency is `org.kodein.di:kodein-di`. ```kotlin import org.kodein.di.* val di = DI { bind() with singleton { UserRepositoryImpl() } } ``` -------------------------------- ### Ksoup HTML Parsing Source: https://context7.com/terrakok/kmp-awesome/llms.txt A library for parsing HTML content in Kotlin, enabling extraction of data from web pages. It provides a convenient API for navigating and querying the HTML structure. The dependency is `com.fleeksoft.ksoup:ksoup`. ```kotlin val doc = Ksoup.parse("

Hello

") val text = doc.select("p").text() ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.