smaho-engineering / esptouch_flutter

ESP-Touch Dart API for Flutter. Platform-specific implementation for Android (Java) and iOS (Objective-C).
https://pub.dev/packages/esptouch_flutter
MIT License
100 stars 34 forks source link

Add kotlin #2

Closed komputerboy closed 4 years ago

komputerboy commented 4 years ago

I try to run your example and it perfectly works. But when i try to implement to my own apps it is not working.

The problem is i am using kotlin file, but in your project is using java file. So please add example using MainActivity.kt (kotlin file)

Thanks

vincevargadev commented 4 years ago

@komputerboy Are you sure that it's the Kotlin vs Java that's causing the issue? It should not matter and I just created an example app using Kotlin as the Android language that successfully runs ESP Touch tasks: https://github.com/smaho-engineering/esptouch_flutter_kotlin_example

I created the Flutter app with the following command (FYI: --android-language defaults to Kotlin, so the only reason I added it is to be explicit).

flutter create --android-language kotlin .

You can see in commit https://github.com/smaho-engineering/esptouch_flutter_kotlin_example/commit/f97ca3a1ad7f0be40a2cc03e811944b04682378c the changes you need to make to your project to get a very basic example working.

Please keep in mind that the esptouch_flutter package is a Flutter package and you should be interfacing with it using the Dart programming language. If you find that you want to call esptouch related commands from your Kotlin files, you should consider using the original ESP module that you can find here: https://github.com/EspressifApp/EsptouchForAndroid

I'm closing this issue now, but if you still have issues with the esptouch_flutter package, please feel free to open a new issue with a new description.