expect fun platform() // androidMain actual fun platform() = "Android" // iosMain actual fun platform() = "iOS" // desktopMain actual fun platform() = “Desktop" ✅
} expect class Platform { val name: String } // androidMain actual class Platform { actual val name: String get() = "Android" } // iosMain actual class Platform { actual val name: String get() = "iOS" } // desktopMain actual class Platform { actual val name: String get() = "Desktop" } ⚠ Beta
rt ed-pla tf orms.html Android Stable iOS Stable Desktop (JVM) Stable Server-side (JVM) Stable Web based on Kotlin/Wasm Alpha Web based on Kotlin/JS Stable watchOS, tvOS Best effort
val Context.dataStore: DataStore<Preferences> by preferencesDataStore("settings") Link: h tt ps://developer.android.com/topic/libraries/architecture/datastore
Entity @Entity data class User( @PrimaryKey(autoGenerate = true) val id: Long = 0, @ColumnInfo(name = "name") val name: String, ) Link: h tt ps://developer.android.com/training/data-storage/room
{ // @Query("SELECT * FROM user") fun getAll(): List<User> @Query("SELECT * FROM user") fun getAll(): Flow<List<User>> // @Insert fun insertAll(vararg users: User) @Insert suspend fun insertAll(vararg users: User) } Link: h tt ps://developer.android.com/kotlin/multipla tf orm/room
"database-name.db" val db = Room.databaseBuilder<AppDatabase>( context = applicationContext, name = application.getDatabasePath(dbFileName), ) .setDriver(BundledSQLiteDriver()) // or AndroidSQLiteDriver .setQueryCoroutineContext(Dispatchers.IO) .build() Link: h tt ps://developer.android.com/kotlin/multipla tf orm/room ❓