https://kotlinlang.org logo
#compose-desktop
Title
# compose-desktop
v

Vikas Rathod

12/13/2023, 8:54 PM
How can i use platform specific native api without Java Bridge. Like Windows Registries, MacOS System Configuration Framework. I am writing an application to share files across platform (android, ios, mac, linux and windows) Do not wish to write UI in each platform so using compose. The main app will use compose. I wish to share main app UI, business logic (domain), models, viewModel, API call to server and local database operation. The above domain layer will use the platform specific native api. The Toolbar and widget will be written in platform native.
k

Kirill Grouchnikov

12/13/2023, 9:01 PM
Compose is on top of Kotlin which is (kinda if you squint the right way) on top of Java. If you want to call native APIs, you use JNI bindings.
👍🏻 1
v

Vikas Rathod

12/13/2023, 9:08 PM
Can I have UI JVM -> Kotlin Native -> Native Framework
a

Alexander Maryanovsky

12/13/2023, 9:33 PM
You can through cinterop. Here’s a reddit thread where someone did that: https://www.reddit.com/r/Kotlin/comments/12vmtfb/mix_kotlin_native_with_jvmandroid_kotlin/
👍 1
v

Vikas Rathod

12/13/2023, 10:57 PM
@Alexander Maryanovsky I thing this will not work. cinterop converts static library to be used in kotlin. Use case is to use static library on JVM.
4 Views