Kotlin / Compose Desktop 初体验之踩坑;对标 Flutter ?

Compose 呼之欲出,Flutter 展露锋芒  https://blog.csdn.net/shedoor/article/details/117378430 

Compose Multiplatform 正式官宣,与 Flutter 迟早必有一战?  https://blog.csdn.net/vitaviva/article/details/119564334  

Compose 为什么可以跨平台?  https://blog.csdn.net/vitaviva/article/details/128442401   

Google I/O 公布了 Compose 1.0,你准备好了吗? https://blog.csdn.net/m0_58350991/article/details/117266169  

Android开发:为什么除了Flutter之外,我们还需要另一个跨平台开发框架?(1)   https://blog.csdn.net/2401_84407887/article/details/138373411    

  

Flutter :MIT 协议。有许多 MIT 协议的第三方库、包,可以免费使用。flutter 好像被幕后金主 g 边缘化了?  https://news.qq.com/rain/a/20241030A0865H00   由于是 MIT 协议,fork flutter /  Flock Flutter+ 又开始了,但如果没有足够金钱支持的话,未来又该走向哪里呢?
MIT,自由是它的亮点,也许社区能够支撑其后续的发展吧?

Compose Desktop :Apache License 2.0  https://github.com/JetBrains/compose-multiplatform/blob/master/LICENSE.txt  Compose Desktop 是近年才开始流行?库、包的支持如何?
Compose Desktop 好像和 Qt 一样?在某些场合的使用需要收费?或者像 Qt、安卓那样,初期免费,后期会走向收钱?

JetBrains还表示,他们的目标是在2024年发布面向iOS的Compose Multiplatform测试版,Kotlin/Wasm也在积极开发中。目前Kotlin Multiplatform和Compose Multiplatform均可免费使用。  https://www.51cto.com/article/772087.html 

目前 xxx 均可免费使用?需要白老鼠,等产品成熟之后,再收钱?和 Qt 类似?

一种说法:

Compose 采用原生的渲染,Flutter 采用自定义的渲染;在地图显示之类的应用中,Flutter 有延迟,所以有人会说 Compose 好。

关键的问题、是:

1. 当延迟的时间被控制在容许的门限之内时,那么,再快也就没有什么迫切的意义了。Flutter 是否可以办到呢?当 显示处理芯片 的运算速度越来越快时?

2. 编程的 AI 化:flutter 在 vscod 中有 AI 插件。

3. Flutter 采用的是 MIT 协议。也许和 Linux OS 一样,各有各的市场份额,共存吧?

Compose Multiplatform

  https://github.com/JetBrains/compose-multiplatform?tab=readme-ov-file 

Compose Multiplatform is a declarative framework for sharing UIs across multiple platforms with Kotlin. It is based on Jetpack Compose and developed by JetBrains and open-source contributors.

You can choose the platforms across which to share your UIs using Compose Multiplatform:

For example, you can share UIs between iOS and Android or Windows and MacOS.

Shared UIs of the iOS, Android, desktop, and web apps

Kotlin Multiplatform Development  https://www.jetbrains.com/zh-cn/compose-multiplatform/ 

是否要收费?如何收费?社区版?库或包在哪里获取?
如果要收费的话,那么,在某些场景里,Qt 也是不错的选择?

  https://www.jetbrains.com/idea/buy/?section=commercial&billing=yearly 

  https://github.com/equationl/calculator-Compose-MultiPlatform 

使用 Compose Muiltplatfo 实现的计算器,支持移动端(Android、iOS)端和桌面端(Windows、macOS、Linux),迁移自:GitHub - equationl/calculatorCompose: 这是一款完全使用 Jetpack Compose 实现的计算器 APP , 支持标准计算器和程序员计算器,支持深色模式,支持自动旋转,支持悬浮窗计算器。兄弟项目:使用 Compose Multiplatform实现的跨平台计算器:https://github.com/equationl/calculator-Compose-Multiplatform

摘录:Compose Desktop 初体验之踩坑   

  https://zhujiang.blog.csdn.net/article/details/128332097   

对标 Flutter ?

Flutter 现在已经比较成熟了,它最大的优势就是跨平台,Flutter 虽然宣称的是原生的性能,一套代码多端实现,但其实对于跨平台来说一套代码并不能完全实现需求,肯定需要各种适配,只不过看框架适配的好与坏,

Compose Desktop 也是如此,但 Flutter 的性能也只是媲美原生,而 Compose 就是原生啊!Compose Desktop 其实并不是和 Flutter 抢饭碗,它只是告诉广大安卓开发:你们并不需要学习安卓之外的东西就能开发各种设备上的应用!这也是 Kotlin 的辉煌,我个人认为这也是 Jetbrains 公司开发 Compose Desktop 的初衷。

基于上面的分析,打开了 Jetbrains 的 Compose Desktop 的官网:https://www.jetbrains.com/zh-cn/lp/compose-desktop/ ,也开始试着玩一玩桌面版的应用!

原文链接:https://blog.csdn.net/haojiagou/article/details/128332097

Kotlin Multiplatform 入门:构建你的第一个跨平台应用  https://juejin.cn/post/7428571709474684937    

摘录:JetBrains联合谷歌搞事情!首发稳定版Kotlin跨平台开发框架!

  https://www.51cto.com/article/772087.html 

2、逻辑和UI共享均实现,与Flutter竞争加剧

Kotlin Multiplatform用于非GUI代码,但有一个相关的项目Compose Multiplatform,用于创建共享的UI。

Compose Multiplatform是基于谷歌的Jetpack Compose的跨平台共享UI声明式框架。据悉,通过将Kotlin Multiplatform与Compose Multiplatform相结合,开发者不仅将获得更高的自由度,还可以在Kotlin中实现高达100%的代码库共享。

此前KMM主要实现的是共享逻辑,UI层的实现还是建议平台各自去处理,而在Compose Multiplatform加入后,成为了逻辑和UI都可以实现共享的结果。再加上有Android官方推荐的Buff加身,发布稳定版后与Flutter的竞争必然会加剧。

当前Compose Multiplatform在桌面平台、macOS、Linux和Windows上也很稳定,但在iOS上是Alpha版本,在Web上是实验性的。

如果Compose Multiplatform尚未准备就绪,开发者如何支持iOS呢?这可以通过使用SwiftUI实现,SwiftUI是苹果的官方UI设计语言,它基于声明性代码。有一些代码示例正是采用了这种方法。

JetBrains还表示,他们的目标是在2024年发布面向iOS的Compose Multiplatform测试版,Kotlin/Wasm也在积极开发中。目前Kotlin Multiplatform和Compose Multiplatform均可免费使用。

3、全球大厂纷纷拥抱:KMM好用在哪里

面向日趋上升的跨平台开发需求,Kotlin Multiplatform稳定版的首发无疑是一个好消息。保持代码共享的同时又保留了一定的原生灵活性,允许根据特定平台的需求进行定制和扩展,这让KMP成为了一个极有潜力的开发框架,为开发者提供了更多的选择空间。

e: file:///D:/yj/g/x/Android/AideProjects/KotlinPro/shared/src/androidMain/kotlin/com/petterp/floatingx/compose/FxComposeLifecycleOwner.kt:9:27 Unresolved reference 'ViewTreeLifecycleOwner'. e: file:///D:/yj/g/x/Android/AideProjects/KotlinPro/shared/src/androidMain/kotlin/com/petterp/floatingx/compose/FxComposeLifecycleOwner.kt:10:27 Unresolved reference 'ViewTreeViewModelStoreOwner'. e: file:///D:/yj/g/x/Android/AideProjects/KotlinPro/shared/src/androidMain/kotlin/com/petterp/floatingx/compose/FxComposeLifecycleOwner.kt:13:28 Unresolved reference 'ViewTreeSavedStateRegistryOwner'. e: file:///D:/yj/g/x/Android/AideProjects/KotlinPro/shared/src/androidMain/kotlin/com/petterp/floatingx/compose/FxComposeLifecycleOwner.kt:15:1 Class 'FxComposeLifecycleOwner' is not abstract and does not implement abstract member 'lifecycle'. e: file:///D:/yj/g/x/Android/AideProjects/KotlinPro/shared/src/androidMain/kotlin/com/petterp/floatingx/compose/FxComposeLifecycleOwner.kt:21:5 'getLifecycle' overrides nothing. e: file:///D:/yj/g/x/Android/AideProjects/KotlinPro/shared/src/androidMain/kotlin/com/petterp/floatingx/compose/FxComposeLifecycleOwner.kt:23:5 'getSavedStateRegistry' overrides nothing. e: file:///D:/yj/g/x/Android/AideProjects/KotlinPro/shared/src/androidMain/kotlin/com/petterp/floatingx/compose/FxComposeLifecycleOwner.kt:25:5 'getViewModelStore' overrides nothing. e: file:///D:/yj/g/x/Android/AideProjects/KotlinPro/shared/src/androidMain/kotlin/com/petterp/floatingx/compose/FxComposeLifecycleOwner.kt:60:13 Unresolved reference 'ViewTreeLifecycleOwner'. e: file:///D:/yj/g/x/Android/AideProjects/KotlinPro/shared/src/androidMain/kotlin/com/petterp/floatingx/compose/FxComposeLifecycleOwner.kt:61:13 Unresolved reference 'ViewTreeViewModelStoreOwner'. e: file:///D:/yj/g/x/Android/AideProjects/KotlinPro/shared/src/androidMain/kotlin/com/petterp/floatingx/compose/FxComposeLifecycleOwner.kt:62:13 Unresolved reference 'ViewTreeSavedStateRegistryOwner'. e: file:///D:/yj/g/x/Android/
03-26
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值