Android, Jetpack, Jetpack Datastore.
UserPreferences { // Implement deserialization logic using Gson, Moshi, or kotlinx.serialization } override fun writeTo(outputStream: OutputStream, value: UserPreferences) { // Implement serialization logic using the chosen library } } suspend fun updateUsername(dataStore: