Giter Club home page Giter Club logo

kotlinmultiplatform's 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:

  • MockK: mocking library for Kotlin

Android App - Master Branch

With this app you can get the weather of your locations using KTor:

And add and save on SQLDelight database your favourite locations:

iOS App

Open XCode and select the project:

JVM - Desktop App

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")

JS App

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

I have followed these examples:

https://kotlinlang.org/docs/tutorials/native/mpp-ios-android.html

https://www.raywenderlich.com/1022411-kotlin-multiplatform-project-for-android-and-ios-getting-started

https://proandroiddev.com/kotlin-multiplatform-very-beginners-guide-part-3-database-e34c92daf41c

kotlinmultiplatform's People

Contributors

jarroyoesp avatar louiscad avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.