HQAnime / AnimeOne

anime1的非官方APP
MIT License
150 stars 3 forks source link

Jetpack Compose #35

Closed HenryQuan closed 2 years ago

HenryQuan commented 2 years ago

I can experiment with Jetpack Compose on a new branch. It is very interesting to see what it can achieve.

HenryQuan commented 2 years ago

It has been great so far. Navigation Rail is nice, but I think it is better to use the bottom navigation for now. I am copying code from dart. Overall, this shouldn't be that hard.

PGautam27 commented 2 years ago

I know right. It's been about 8 months since I started using jetpack compose. And yet I learn something new everyday.

HenryQuan commented 2 years ago

This is on hold now since it is possible to sideload the iOS version with AltStore or TrollStore. However, I may come back again to have a fully native Compose version. The native experiment is always better where Flutter supports far more platforms.

PGautam27 commented 2 years ago

Indeed flutter supports far more platforms. But I still feel over the years KMM would have an upper edge over flutter. As it allows you to build native apps with just kotlin.

HenryQuan commented 2 years ago

@PGautam27 You are absolutely right. KMM is very promising in my opinion. However, it is never about using only one language if you want to build cross platform apps. What KMM does is sharing low level code and business logic between Android and iOS. However, UIs are still independent (Compose for Android & SwiftUI for iOS) so you still need to know Swift/Obj-C and understand how iOS works.

KMM has great libraries like Ktor and databases, but there are still many things missing like a basic HTML/DOM parser so you have to do it twice. It is definitely fun to explore and make this app fully native on Android and iOS. For a solo developer like me, however, Flutter is better because it supports all platforms and the UI is very consistent on them. However, I am not giving up on Jetpack Compose. It simply has a lower priority now. This app was built in Flutter within a week and works on two platforms. This is not something I could achieve if it is a native Android and iOS app.

Before Flutter, I was using React Native because I thought I could write once for two platforms. However, I relied heavily on third party libraries because I didn't have any knowledge of Android and iOS. Therefore, I couldn't implement any native features unless there is a package.

You cannot really say one technology is better than another one. They all have pros and cons. Please see the native channel I did with this repo, here and here. This won't be possible unless you know both Flutter and native Android. If I want to support other platforms, I need to implement it again in Swift (for iOS & macOS) or C/C++ (for Windows & Linux). There is no shortcut. To support more platforms, you have to learn and adapt to those platforms.

Thank you for your comment.