SMShare is a Kotlin Multiplatform project targeting Android, iOS, Web, Desktop. The UI of SMSahre is written completely in Jetpack Compose and shareed accross iOS, Android and Desktop.
/composeApp
is for code that will be shared across your Compose Multiplatform applications./iosApp
contains iOS applications./core
- Contains the core components of the codebase as shown below:/common
- App Common code [WIP]/config
- App Config [WIP]/datbase
- Database integration usingRoom
+SQLite
/datastore
- Datastore intgration using
Jetpack Datastoreand
kotinx.serialization`/doomain
Contains the usecases [WIP]/model
- UI models / domain models used in the app/network
- Network integreation usingktor
andkotlin.serialization
/rpc
- RPC integration usingkotlinx.rpc
[WIP]
Android, iOS and Desktop screenshot sample
You will require the following rools to build and run SMSahre
- Android SAndroid Studio Jellyfish | 2023.3.1 or higher
- Java 17 installed
- Xcode Version > 15.4
Android
Open the KMP project using Android Studio, select the composeApp
run configuration and click on
run.
Fleet uses Smart Mode to detect and configure the Android run configuration for you.You can modify in the Run Json file
To run the Android app, use the command below or select the composeApp
configuration on Android
Studio and click on run.
Desktop
Fleet uses Smart Mode to detect and configure the Android run configuration for you.You can modify in the Run Json file
./gradlew desktopRun -DmainClass=com.jerryokafor.smshare.MainKt --quiet
iOS
Open iosApp/iosApp.xcworkspace
from Xcode and run.
Note: You need to have run pod install
from the iOSApp
directory app
Fleet uses Smart mode to configure iOS run configuration for you. You can modify in the Run Json file
Server
Fleet uses Smart mode to detect and configure the various run configurations for you for iOS, Android, Desktop and Server. Ensure the You have Xcode, Android Studio, iOS Simulator, Android Emulator all installed or Physical iphone and Android Devices plugged in.
To run the server code, you can run the gradle command below:
./gradlew :server:run
Open: http://0.0.0.0:8080/
or http://localhost:8080/
to see the response from the server.
To access server from your Android device, run adb reverse tcp:8080 tcp:8080
and then access the
app on http://<PC IP>:8080/
Ensure yuor android phone is connected and adb is running, then run
adb reverse tcp:8080 tcp:8080
Then open http://localhost:8080
from your android phone to test. You can now also use this in the
base url of
your api requests for Android.
For iOS, you can follow this guide : How to open a localhost website on iPhone / iOS
./gradlew :composeApp:connectedAndroidTest
./gradlew :composeApp:iosSimulatorArm64Test
./gradlew :composeApp:desktopTest
./gradlew :composeApp:wasmJsTest
./gradlew detekt ktlintCheck
./gradlew detektProjectBaseline
ktlint -F --baseline=config/ktlint/baseline.xml
or Using Gradle command
./gradlew ktlintFormatBaseline
- Add KtLint and Detekt
- Add Detekt
- Add Kover
- Add Codecov
- Add Code style to readme
- Add Contributors section
- Add License section
- Add Room KMP database
- Add Datastore
- Testing Compose Multiplatform UI
- Jetpack Room KMP
- Advanced work with the Snackbar in the Jetpack Compose
- FantasyPremierLeague
- Tivi
- Compose Custom Window frame
- Targeting Android in KMP
- Understanding and Configuring your Kotlin Multiplatform Mobile Test Suite
- KMM-PicSplash
- Native distributions & local execution
- GitHub Actions: Firebase Test Lab
If you've found an error in this sample, please file an issue.
Patches are encouraged and may be submitted by forking this project and submitting a pull request.Since this project is still in its very early stages, if your change is substantial, please raise an issue first to discuss it.
The MIT License (MIT)
Copyright (c) 2024 SMShare Projects
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.