Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Kotlinmultiplatform | 547 | 3 years ago | 2 | gpl-3.0 | Kotlin | |||||
Kotlin MultiPlatform App (Android, iOS, JVM & JS). MVVM/MVP - Kotlin MultiPlatform | ||||||||||
Tddweatherapp | 18 | 4 years ago | Kotlin | |||||||
Android App trying to apply TDD and using MVVM, Kotlin Coroutines | ||||||||||
Myweatherkotlinflow | 15 | 3 years ago | Java | |||||||
Android app that shows weather at your current location or any custom location you specify. Uses Kotlin Flow for data streaming and coroutines for asynchronous work. Also leverages Room, navigation component, Viewmodel and Livedata Jetpack components with MVVM presentation layer architecture. Dagger 2 with Dagger android for dependency injection | ||||||||||
Weather Clean Architecture | 3 | 15 days ago | Kotlin | |||||||
A weather android app demonstrates Clean Architecture and is written in Kotlin. | ||||||||||
Foreksty | 2 | 3 years ago | Kotlin | |||||||
A simple and nice looking weather forecast application. Developed using Kotlin, MVVM architecture, Dagger 2, Kodein, Coroutine, RxJava 2 | ||||||||||
Weathercomfort | 2 | 3 years ago | 1 | mit | Kotlin | |||||
A simple Weather App |
This example shows how to create a simple Android/iOS/JVM/JS project sharing some Kotlin code. This app saves on a local database your favourites locations and get the current weather of them from OpenWeatherMap.
In this app we share common code for both platforms (Android/iOS) to get data from an API (in this case OpenWeatherMap). The libraries that we use are:
Tests:
With this app you can get the weather of your locations using KTor:
And add and save on SQLDelight database your favourite locations:
Open XCode and select the project:
To execute this version as desktop app, you have to execute this code on your console:
./gradlew JavaFxApp:run
By default the JDBC SQLite is created in memory. If you want to persist your database in your disk, you have to indicate the path when you create the database driver:
SQLDriver.kt
JdbcSqliteDriver("jdbc:sqlite:$your_database_path")
If you want to launch a web to get the weather you can try executing the next commands:
./gradlew JsApp:run
./gradlew BackEnd:run
--> localhost:8080
Current weather is not shown when you launch the browser? If you have this problem (Module not found: Error: Can't resolve 'core-js/features/object/assign') try to reinstall the node module core-js:
npm install core-js
I have followed these examples:
https://kotlinlang.org/docs/tutorials/native/mpp-ios-android.html
https://proandroiddev.com/kotlin-multiplatform-very-beginners-guide-part-3-database-e34c92daf41c