[Interest] Android: use Kotlin alongside with Java?

Assam Boudjelthia assam.boudjelthia at qt.io
Mon Jan 11 09:58:25 CET 2021


Hi,

You should be able to add kotlin code same way as Java code, however you need some changes to the Gradle configs. I added a template of build.gradle that can use Kotlin under https://bugreports.qt.io/browse/QTBUG-86894, you can use that, I used that with a simple Qt app that uses Java and kotlin, that should at some point be part of the default gradle file or documented somewhere.

Best regards,
Assam

From: Interest <interest-bounces at qt-project.org>
Date: Friday, January 8, 2021 at 6:27 PM
To: Alexander Dyagilev <alervdvcw at gmail.com>, interest at qt-project.org <interest at qt-project.org>
Subject: Re: [Interest] Android: use Kotlin alongside with Java?
On 1/8/21 11:20 AM, Kyle Edwards wrote:
> Yes, you can put it in with your Java source.
>
> If you're using Gradle, you may need to import a Kotlin plugin (if
> there is one).

I will also add this: Kotlin is very well-supported in Android, and in
fact has become the recommended primary language for Android
development. The Android documentation would probably be a better guide
than the Qt documentation.

Kyle

_______________________________________________
Interest mailing list
Interest at qt-project.org
https://lists.qt-project.org/listinfo/interest
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20210111/1657b6e6/attachment.html>


More information about the Interest mailing list