airsdk / Adobe-Runtime-Support

Report, track and discuss issues in Adobe AIR. Monitored by Adobe - and HARMAN - and maintained by the AIR community.
200 stars 11 forks source link

[Feature Request][Android] Kotlin native extensions support #2046

Open itlancer opened 2 years ago

itlancer commented 2 years ago

Feature Description

AIR should support native extensions developed using Kotlin for Android platform. Nowadays many Android third-party libraries supports only Kotlin, not Java. Moreover it has more performance and recommended by Google for Android. Even some new Android libraries support only Kotlin: https://developer.android.com/guide/topics/renderscript/migrate#intrinsics

Related issue: https://github.com/airsdk/Adobe-Runtime-Support/issues/1632

Known Workarounds

Use https://github.com/tuarua/FreKotlin-Android-ANE

marchbold commented 2 years ago

It's not that hard to keep the main freextension, frecontext and frefunctions as java and use kotlin for everything else in your extension. Kotlin is designed with java interoperability in mind so they work well together. We actually do this in several of our extensions already.

tuarua isn't really a workaround but just a demonstration on how you can use kotlin in an ANE. He does take it to the next level and create utilities for returning / converting freobjects but this is really implementation side of an ANE.