Multiplatform Key-Value Store for Android & JVM.
PolyKV for Kotlin is designed for the modern Android developer. It abstracts away the complexity of SharedPreferences and File I/O behind a clean, coroutine-based interface.
One API, Everywhere. This library is part of the PolyKV ecosystem. Use the same consistent API across 12+ languages.
-
🤖 Android First Deep integration with Android Context and Lifecycle. Uses
SharedPreferencesunder the hood for maximum compatibility. -
🚀 Coroutine Powered All operations are
suspendfunctions. Never block the Main Thread again. -
🖥 Desktop Ready Runs on the JVM too! Share your logic code between your Android App and your Desktop Server side seamlessly.
implementation("com.polykv:polykv:1.0.0")import com.polykv.PolyKV
import androidx.lifecycle.lifecycleScope
// In Activity/Fragment
val kv = PolyKV("MyApp", context = this.filesDir)
lifecycleScope.launch {
// 1. Save
kv.setString("auth_token", "jwt-xyz")
kv.setNumber("volume", 50.0)
// 2. Read
val token = kv.getString("auth_token")
// 3. Update
kv.setNumber("volume", 100.0)
// 4. Delete
kv.remove("auth_token")
// 5. Clear All
kv.clear()
}// On Desktop/Server, no Android Context needed
val kv = PolyKV("MyApp")| Language | Verified Runtime (✅) | Build Only (🛠) |
|---|---|---|
| TypeScript | CLI (Node.js), Browser, React Native (iOS/Android) | - |
| Dart | Flutter (iOS/Android/macOS), CLI | - |
| Go | macOS, Linux, Windows, iOS, Android, CLI | - |
| Rust | macOS, iOS, Android, CLI | Linux, Windows |
| Swift | iOS, macOS, CLI | - |
| C++ | macOS, iOS, Android, CLI | - |
| Python | CLI, Web, Android | - |
| Kotlin | CLI, Web, Android | - |
| C# | CLI | Android, Windows |
| Java | CLI, Android | - |
| Ruby | CLI | - |
| PHP | CLI | - |
✅ Runtime Verified: Full CRUD operations verified via automated tests on actual devices/simulators.
MIT