如何使用正确的方法使用 Compose for Desktop 构建 Microsoft 和 Mac OS 应用程序
我需要使用 Jetbrains Compose Multiplatform< 开发适用于 Windows 和 Mac OS 的桌面应用程序br> 我将使用 Kotlin 语言来设计 UI。
但我需要以下几点指导:
- 桌面应用程序中的核心逻辑/计算/网络客户端等需要哪些语言?
- 我们可以用 Kotlin 编写整个 Microsoft 桌面应用程序(Compose for Desktop)吗?
- 我们可以在 Compose for 中使用
Fragment
、ViewModels
、Room
等 Android 类吗?桌面 ? - 如果我们不能在桌面应用程序中使用 Android 类,那么我们在 Android 的
ViewModel
类中编写的代码应该在哪里编写呢?如何构建代码和包 - 对于使用 Compose 或 Desktop 构建的桌面应用程序来说,最佳架构是什么? ?
我找不到 Desktop Compose 应用程序的任何架构图 - 我们可以使用 Jnuit 和 Espresso 在 Compose for Desktop 中编写 UI 和 Instrumented 测试吗?
注意:
- 我已经阅读了 compose Desktop 的官方文档。
我还浏览了示例和多个博客的代码,但上述问题没有得到明确的回答。
因此我需要你的指导
I need to develop a desktop app for Windows and Mac OS with Jetbrains Compose Multiplatform
I will use the Kotlin language to design the UI.
But I need guidance on following points:
- Which languages will be required for the core logic / calculations / network client, etc. in the desktop app ?
- Can we write the entire Microsoft desktop app in Kotlin (Compose for Desktop)
- Can we use Android classes like
Fragment
,ViewModels
,Room
in Compose for Desktop ? - If we cannot use Android classes in desktop app then, where do we write the code which we write in
ViewModel
classes in Android ? How to structure the code and packages - What is the best architecture for Desktop app which are being built with Compose or Desktop. ?
I could not find any architecture diagram for Desktop Compose App - Can we use Jnuit and Espresso for writing UI and Instrumented tests in Compose for Desktop ?
Note:
- I have gone through the official documentation of compose desktop.
I also went though the code of samples and multiple blogs, but the above queries are not answered clearly.
Hence I need your guidance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
1,2 — 我想任何 JVM 兼容的语言都可以。
3,4 — https://github.com/JetBrains/compose-jb/discussions/第1587章
我不是 Compose for Desktop 方面的专家,因此我不想回答最后两个问题。另外,我建议您在 Kotlin 的 #compose-desktop 频道中搜索答案官方 Slack 工作区(获取邀请 此处)。
1,2 — I guess that any JVM-compatible language would be fine.
3,4 — https://github.com/JetBrains/compose-jb/discussions/1587
I am not an expert in Compose for Desktop, so I would prefer not to answer the last two questions. Also, I would recommend you to search for answers in the #compose-desktop channel of the Kotlin official Slack workspace(get an invite here).