在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):jarroyoesp/KotlinMultiPlatform开源软件地址(OpenSource Url):https://github.com/jarroyoesp/KotlinMultiPlatform开源编程语言(OpenSource Language):Kotlin 91.5%开源软件介绍(OpenSource Introduction):Kotlin-Multiplatform (Android, iOS, JS & JVM Desktop 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:
Android App - Master BranchWith this app you can get the weather of your locations using KTor: And add and save on SQLDelight database your favourite locations: iOS AppOpen XCode and select the project: JVM - Desktop AppTo execute this version as desktop app, you have to execute this code on your console:
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:
JS AppIf you want to launch a web to get the weather you can try executing the next commands:
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:
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 |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论