This repo contains the code that was the subject of a "Kotlin Office Hours" presentation called "Idioms in Kotlin".
This presentation can be found here:
https://drive.google.com/open?id=1co09CMF7g9rhmrqiw73YSpixThP644grxo3iBrNB1FA
The MainActivity is nothing more that a dummy shell around a simple example that shows the definition and the usage of a DSL that defines Bluetooth Low Energy (BLE) services.
The rest of the code defines the definition and the usage of the BLE-DSL.
The best place to start looking at this code is
- Look at the DSL defining a BLE Service first:
./app/src/main/kotlin/io/intrepid/bleidiom/app/BleModel.kt - Then look at the interface defining this DSL:
./app/src/main/kotlin/io/intrepid/bleidiom/BleIdiom.kt - And look at the usage of this DSL:
./app/src/main/kotlin/io/intrepid/bleidiom/app/MainActivity.kt
Install dependencies by building the project. It doesn't require any other special configuration to run.
There are no special configurations or build-flavors.
The app must be run on a device (as emulators don't support Bluetooth) and you should install the Node.js-module Bleno.
https://github.com/sandeepmistry/bleno
Clone the above repo.
Follow the installation instructions.
Replace contents of directory ./examples/battery-service/ with the scripts from the bleno-demo-scripts.
Run them by executing node main.js in your terminal/shell.
Be sure to turn on your PCs/Macs Bluetooth!
There are no UI tests currently.
- master: For now, there is only a master branch.
It's a work in progress, there may be some :)
Please, tell us!
- https://www.meetup.com/kotlin-office-hours/events/243635842
- https://www.meetup.com/kotlin-office-hours
App is on GitHub only
- 2/6/2017: 0.0.1 Initial version, the code that's part of the KOH presentation "Idioms in Kotlin"