Skip to content

polykv/polykv-kotlin

Repository files navigation

PolyKV - Kotlin

Kotlin Version License Stars Platform

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.

✨ Why PolyKV Kotlin?

  • 🤖 Android First Deep integration with Android Context and Lifecycle. Uses SharedPreferences under the hood for maximum compatibility.

  • 🚀 Coroutine Powered All operations are suspend functions. 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.

📦 Installation

Gradle (Kotlin DSL)

implementation("com.polykv:polykv:1.0.0")

🚀 Usage

Complete Workflow (Android)

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()
}

JVM Support

// On Desktop/Server, no Android Context needed
val kv = PolyKV("MyApp")

🌍 Platform Support

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.

📜 License

MIT

About

Zero-Config, Native Key-Value Store for Kotlin

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages