This is the Bangle.js First Application guide completely written in Kotlin JavaScript for the The World's first Open Source Hackable Smart Watch.
./gradlew assemble
You can find the compiled code in build/js/packages/Kangle/kotlin/Kangle.js
.
Or use this gist: https://gist.github.com/Xaseron/5527e10f225823b99bf2a55db435fdb2
The simplest way to run this code is to copy the file or gist and paste it into the Emulator.
This project consist of two files:
Main.kt
: resembles the official First Application guideExternals.kt
: type definition of every Espruino API used by the application
There is a lot of room for improvement. My JavaScript knowledge is very limited. Help is very much appreciated. PRs welcome.
Currently, they are all defined manual. It would be nice to somehow import than. The Emulator has some type hints, so this might be possible. The other possible solution would be to auto generate them.
At the moment plain Kotlin + Espruino API is usable. The Kotlin stdlib is partial working thanks to Dead Code Elimination (DCE).