How to use jetpack compose with java? #compose#compose-android
😂 3
🚫 11
s
Sam Stone
08/17/2023, 5:11 AM
Just translate the Java to Kotlin using the Intellij plugin. You might also be able to reference Java classes when targeting the JVM, but I am not sure.
r
romainguy
08/17/2023, 5:34 AM
@SanjayKarki Jetpack Compose requires Kotlin, in large part because it uses a Kotlin compiler plugin
➕ 3
❤️ 2
s
SanjayKarki
08/17/2023, 5:40 AM
thanks you guys for the information.
m
Michael Paus
08/17/2023, 8:41 AM
@SanjayKarki You have not clearly specified what kind of java usage you have in mind. If you are running a Kotlin compose application on a JVM (or Android) then it is no problem to use that in combination with any compatible Java code. If however you are asking whether you can call composable functions directly from Java then the answer is no for the reasons which were mentioned already.