Skip to content

Latest commit

 

History

191 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

KMPToolkit

A collection of small, independent Kotlin Multiplatform libraries (Android + iOS) — haptics, audio record/playback, local scheduling, secure key-value storage, permissions, notifications, raw accelerometer readings, and a database-agnostic transactional uploader. Each module is published as its own artifact — take only what you need — and the whole suite is released together on a single version, so two KMPToolkit artifacts on one classpath can never come from different releases.

Maven Central License: MIT Kotlin Multiplatform Android iOS

Why small modules instead of one library

Every artifact solves exactly one problem and depends on as few others as possible. You add kmptoolkit-haptics without pulling in an uploader engine, a notification system, or Compose. See docs/01-architecture.md for the principles every module follows (no bundled DI framework, no hardcoded consumer identifiers, no user-facing text) and why.

Modules

Artifact What it solves Depends on Status Docs
kmptoolkit-bom Pins every artifact below to one version — import this first Available install
kmptoolkit-logging Minimal tag/level logging interface + pluggable sinks, zero dependencies Available docs
kmptoolkit-haptics Haptic feedback, with the outcome reported rather than thrown Available docs
kmptoolkit-haptics-testing RecordingHapticFeedback double, for testImplementation haptics Available docs
kmptoolkit-flashlight Camera-torch blink cue, with the outcome degraded to a no-op rather than thrown Available docs
kmptoolkit-flashlight-testing RecordingFlashlight double, for testImplementation flashlight Available docs
kmptoolkit-audio-player Audio playback (MediaPlayer / AVPlayer) behind a pluggable engine Available docs
kmptoolkit-audio-player-testing FakePlaybackEngine, for testImplementation audio-player Available docs
kmptoolkit-audio-recorder Audio recording (MediaRecorder / AVAudioRecorder), typed errors instead of throws Available docs
kmptoolkit-audio-recorder-testing FakeAudioRecorder, for testImplementation audio-recorder Available docs
kmptoolkit-scheduler Exact-time one-shot local alarms Available docs
kmptoolkit-scheduler-testing RecordingAlarmScheduler double, for testImplementation scheduler Available docs
kmptoolkit-storage Key-value storage, plain and encrypted, with typed Int/Long/Boolean accessors and a stable device id. Also publishes jvm (a plain properties-file store), for code shared with desktop Available docs
kmptoolkit-storage-testing InMemoryKeyValueStorage, for testImplementation storage Available docs
kmptoolkit-biometric Biometric gate with typed outcomes, an enrolment shortcut and opt-in weak-tier / single-attempt checks; prompt copy is yours Available docs
kmptoolkit-biometric-testing ScriptedBiometricGate, for testImplementation biometric Available docs
kmptoolkit-permission Runtime permission request flow for notifications, microphone, camera, location, audio files and Bluetooth, with status observation, plus special-access permissions (exact alarms, overlay, …) storage, activity (Android) Available docs
kmptoolkit-permission-testing RecordingPermissionHandler / RecordingSpecialPermissionHandler, for testImplementation permission Available docs
kmptoolkit-notification Local notifications, channels, actions, and the notification a foreground service starts with permission Available docs
kmptoolkit-notification-testing RecordingNotifier, for testImplementation notification Available docs
kmptoolkit-uploader Transactional uploader engine (storage-agnostic), with UploadHandler and built-in background HTTP upload transports on Android (WorkManager) and iOS (background NSURLSession) logging Available docs
kmptoolkit-uploader-testing InMemoryUploaderStore, UploaderStoreContract, FakeUploader, RecordingUploadTransport, for testImplementation uploader Available docs
kmptoolkit-uploader-sqldelight SQLDelight-backed UploaderStore, the reference SPI implementation uploader Available docs
kmptoolkit-location Device geographic position: one-shot fix, continuous updates, service-enabled check and re-enable prompt logging Available docs
kmptoolkit-location-testing FakeLocationProvider, for testImplementation location Available docs
kmptoolkit-proximity Proximity sensor (ProximitySensor + ProximityRule) Available docs
kmptoolkit-proximity-testing FakeProximitySensor double, for testImplementation proximity Available docs
kmptoolkit-downloader Resumable background-download engine (transfer-agnostic) logging Available docs
kmptoolkit-downloader-testing FakeDownloader, FakeDownloaderStorage, for testImplementation downloader Available docs
kmptoolkit-activity Scoped access to the currently resumed Activity, with no getter to leak through and a predicate deciding which activities count. The one Android-only module: there is no iOS counterpart to an Activity Available docs
kmptoolkit-systembars Compose system-bar control with per-axis ownership, optional pixel-sampled auto icon styling, and a keep-screen-awake primitive. Also publishes jvm, so a UI tree shared with desktop still compiles activity (Android) Available docs
kmptoolkit-hardware-keys Keeps an app's hardware-key policy (volume and other keys) in force inside Compose dialog windows and sheets on Android, where the Activity's key handling cannot reach. Compose; no-op on iOS; also publishes jvm logging (Android) Available docs
kmptoolkit-systembars-testing RecordingSystemBarsController / RecordingScreenWakeLockController doubles, for testImplementation systembars Available docs
kmptoolkit-logging-overlay Compose in-app log overlay (debug builds only) logging Available docs
kmptoolkit-accelerometer Raw accelerometer readings as a cold Flow, m/s² on both platforms Available docs
kmptoolkit-accelerometer-testing ScriptedAccelerometer double, for testImplementation accelerometer Available docs
kmptoolkit-language App language selection (AppLanguageHolder), a supported-language catalog you populate, and the platform-locale side effect — including the Android Application wiring that keeps a chosen language from reverting. Also publishes jvm, for code shared with desktop Available docs
kmptoolkit-language-compose Compose wiring (AppLocale, mirrorOnRtl/mirrorOnLtr) for kmptoolkit-language. Also publishes jvm language Available docs
kmptoolkit-hijri Umm al-Qura date conversion: LocalDate.toHijriDate(). Also publishes jvm Available docs

See docs/README.md for the full documentation index and the recommended reading order.

Installation

Add the BOM to align every module on one version, then pull in only what you use:

dependencies {
    implementation(platform("io.github.jamal-wia:kmptoolkit-bom:<version>"))
    implementation("io.github.jamal-wia:kmptoolkit-logging")
}

KMP module resolution needs platform() at every source set that declares the dependency, not just commonMain — see KT-58759 if a version fails to resolve on a specific target.

Quick start

class UserRepository(private val loggerFactory: LoggerFactory) {
    private val log = loggerFactory.logger("UserRepository")

    suspend fun loadUsers(): List<User> {
        log.i { "loading users" }
        return emptyList()
    }
}

// production
val repository = UserRepository(createLoggerFactory())

See docs/00-getting-started.md for a from-scratch walkthrough, and each module's own docs/<module>/02-getting-started.md for a runnable example.

Read next

About

No description, website, or topics provided.

Resources

Contributing

Stars

10 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages