https://github.com/santimattius/kmp-shared-preferences
Example using Multiplaform Settings
https://github.com/santimattius/kmp-shared-preferences
kmp-library kotlin-multiplatform
Last synced: 2 months ago
JSON representation
Example using Multiplaform Settings
- Host: GitHub
- URL: https://github.com/santimattius/kmp-shared-preferences
- Owner: santimattius
- Created: 2024-01-02T22:20:00.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-01-10T22:04:16.000Z (over 1 year ago)
- Last Synced: 2024-04-20T14:27:57.365Z (about 1 year ago)
- Topics: kmp-library, kotlin-multiplatform
- Language: Kotlin
- Homepage:
- Size: 223 KB
- Stars: 6
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# KMP SharedPreferences Example
Example using [Multiplaform Settings](https://github.com/russhwolf/multiplatform-settings/tree/main)
https://github.com/santimattius/kmp-shared-preferences/assets/22333101/d17f41b3-5702-4483-bb82-f8ca7872ea99
This is a Kotlin Multiplatform project targeting Android, iOS.
* `/composeApp` is for code that will be shared across your Compose Multiplatform applications.
It contains several subfolders:
- `commonMain` is for code that’s common for all targets.
- Other folders are for Kotlin code that will be compiled for only the platform indicated in the
folder name.
For example, if you want to use Apple’s CoreCrypto for the iOS part of your Kotlin app,
`iosMain` would be the right folder for such calls.* `/iosApp` contains iOS applications. Even if you’re sharing your UI with Compose Multiplatform,
you need this entry point for your iOS app. This is also where you should add SwiftUI code for
your project.## Prepare the environment
- Install and configure the latest JDK 17+.
- If you have Gradle installed, make sure you use Gradle 8.1 or later.
- Install and configure the latest Android Studio for Android samples.
- Install and configure the latest Xcode for iOS samples.Use the [KDoctor](https://github.com/Kotlin/kdoctor) tool to ensure that your development
environment is configured correctly:1. Install KDoctor with [Homebrew](https://brew.sh/):
```text
brew install kdoctor
```2. Run KDoctor in your terminal:
```text
kdoctor
```If everything is set up correctly, you'll see valid output:
```text
Environment diagnose (to see all details, use -v option):
[✓] Operation System
[✓] Java
[✓] Android Studio
[✓] Xcode
[✓] Cocoapods
Conclusion:
✓ Your system is ready for Kotlin Multiplatform Mobile development!
```Otherwise, KDoctor will highlight which parts of your setup still need to be configured and will
suggest a way to fix
them.Learn more
about [Kotlin Multiplatform](https://www.jetbrains.com/help/kotlin-multiplatform-dev/get-started.html)