We Love Kotlin and JVM!
Now it is time to stress the cross-platform nature of the
kt-mvvm-demo you write your application once and deploy it to desktop, Android, iOS and browser
with the help of portable DukeScript presenters.
The sample project comes
with classical Android Gradle
installDebug task to package your application
as an Android
.apk file and deploy it to your device or simulator:
$ ANDROID_HOME=/android-sdk/ ./gradlew installDebug $ ls app/build/outputs/apk/ app-debug.apk
One can package the same code
as an iOS
.ipa file with the help of Intel’s
Multi OS Engine when running on Mac OS X.
First of all list your simulators and then use one of them to launch your
$ ./gradlew moeListSimulators ... - DD9904B6-76CD-4F2D-9153-EC7182878897 - iOS 11.4 - iPhone X ... $ ./gradlew moeLaunch -Pmoe.launcher.simulators=DD9904B6-76CD-4F2D-9153-EC7182878897
The same application
the browser. The
bck2brwsrShow tasks generates necessary
.js files and
launches a browser with the application
$ ./gradlew bck2brwsrShow ... Showing http://localhost:53241/index.html ... $ ls -l web/build/web/ bck2brwsr.js index.css index.html lib main.js
The files in
contain everything needed to execute your application and as such they can be
deployed to any HTTP server as a static content.
With Kotlin MVVM API
you can write your code once, deploy and display it everywhere
gradlew run, Android -
gradlew moeLaunch, browser -
gradlew bck2brwsrShow) while
using the power of Kotlin, its libraries and any other JVM libraries
on every target platform.
The JVM Portability
The fact that one can execute the same Kotlin application on all the above platforms is not like the traditional Kotlin.js and Kotlin.native portability. With Kotlin.xxx one only gets the portability of the Kotlin language, but not the libraries.
kt-mvvm-demo project you may bring with yourself JVM libraries - e.g.
JARs - from your previous life (e.g. written in Java & other JVM languages)
that otherwise can’t go with you to the Kotlin js and native worlds.
We love Kotlin on the JVM!