Demonstrate interaction between B4A and Kotlin
Build the Kotlin Jar
kotlinc example.kt -include-runtime -d h:\master\lib\example.jar kotlinc example.kt -include-runtime -d h:\master\project\lib\example.jar
Build the B4A Wrapper:
../SimpleLibraryCompiler.exe Library_Name h:\master\project - Tool
Example use of Kotlin function using B4A
Sub Globals Dim At() As Int At = Array As Int(5, 7, 1, 4, 9, 2, 1, -1) End Sub Sub Activity_Create(FirstTime As Boolean) Dim kt As Kotlin Log(kt.randomnumber(1,10)) Log(kt.summ(At)) End Sub
Advancing
Building a more advanced jar that requires third part jars can be compiled in this way
kotlinc hello.kt -cp thirdparty.jar -include-runtime -d kotlin.jar