且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

我可以使用相同的kotlin代码库创建android,ios和web吗

更新时间:2022-01-14 02:34:51

理论上,使用 Kotlin Multiplatform ,您最多可以在平台之间获得〜80%共享代码.

With Kotlin Multiplatform, you can get up to ~80% shared code between platforms, theoretically.

是的,这意味着通常您的UI,但是对于每个平台,还必须重写其他特定于平台的内容.

Yes, this means that generally your UI, but other platform specific things also will have to be rewritten for every platform.

就您而言,我认为朝着这个方向前进是有意义的.您将不得不稍微修改一下kotlin代码,创建用于Web和iOS的UI,但是您将获得本机质量,并且可以更好地控制平台.至少如果我已经有kotlin代码库,这就是我会选择的,如果您还有其他问题,请告诉我

In your case, I think it makes sense to move towards this direction. You'll have to adapt your kotlin code a bit, make the UI for Web and iOS, but you'll get native quality, and more control over the platforms. At least this is what I would choose if I already have a kotlin codebase, let me know if you have more questions