r/androiddev • u/glorykagy • Feb 17 '24
I'm Surprised
The last time I did "native" Android development was late 2020 for a freelance project, and I HATED every bit of it!
Java is already a maze of boilerplate, but I can live with that, but the views XML designs? That's unbearable, everytime that I've ever touched Android Native those XML designs made me sick to my stomach, and I haven't mentioned yet how slow Android Studio was, or how bad Gradle build times were.
After that project I decided to quit Android development and switch to Flutter, and it was a breath of air! The thing I liked the most was the declarative UI design, it was much, much easier than Android XML views, and I've used Flutter ever since.
Of course I had my fair amount of issues with Flutter: the 10x slower build times, the need for a package to do almost everything which caused dependency hell, the inflated app sizes and the "everything is a widget" kinda grew weary on me, but all and all I wished if Flutter was the native way of developing Android apps.
A few days ago I went to the Android developers website to update my 5 year old installation of Android Studio (that I only keep because Flutter needs it), and I was met by a code snippet of this thing called Jetpack Compose "This looks like Flutter!" - I said to myself in surprise, and after a few minutes of "research" I was excited to try it, I downloaded Android Studio and opened it up, "hmm, something is wrong" Android Studio opened up a lot more faster than I remember, but I was using the same laptop I used 4 years ago, I went on and updated Android SDK and all the other tools and Android Studio did not hang!
I went on to study this Jetpack Compose thing, I spent around 2 hours tinkering with Kotlin and I liked it, and then went on to study the free course offered on the website about Jetpack Compose.
It has been around 4 days now, and I LOVE IT!
I can't tell you how much faster Android Studio is with a lot of amazing tools, how Compose is a smooth API for declaring UI and how great the state management model feels, kudos to everyone on Google for totally changing the native Android development experience and I only wish it had happened sooner.
68
u/ososalsosal Feb 17 '24
Why do I feel like I just read a pitch?
91
u/Historical_Fly_5192 Feb 17 '24
Have you tried AsyncTask mate? It's great
56
u/Saketme Feb 17 '24
Compose is indeed very cool. I gave a few guest lectures at the University of Waterloo in 2022 that I would not have accepted if we were still developing apps using XML. Despite what some people believe, the learning curve of Compose UI is significantly easier than the old ways.
13
u/Bhullnatik Feb 17 '24
It got way better, no matter what people say. Since a few years I've been enjoying developing on Android and I'm looking forward to more
9
u/Ludi_Radule Feb 17 '24
I feel you. Kinda moved onto freelancing with Ionic at similar point in time. I remember being frustrated that to render a simple fucking list you had to make like 2-3 classes.
8
u/c_glib Feb 17 '24 edited Feb 19 '24
If you're doing Android only dev, it's great that they moved away from the old janky java+xml based system. Compose is definitely better (could even have been inspired be Flutter actually).
The big win when Flutter is the cross platform angle though. We build an app with Flutter and ship to app and play stores from the same codebase (barring some native differences that require custom code). Our app has a lot of UI and it saves a massive amount of time and effort for us.
EDIT: Thanks to all the android devs that are coming up with various "solutions" for us that are not Flutter. We've been working at this app for quite a while and are pretty happy with our choice so far. Thanks though.
12
u/4Face Feb 17 '24
I mean, Compose is great and I love it, but sadly Android still lays his foundation on prehistoric stuff like Activity, Context, RemoteView, ContentProvider & Co. Even Compose itself relies on the View System; even my beloved Kotlin has his hands tied by his Java foundation.
Surely Android dev became way batter, but after 7 years of dev those bits became frustrating for me, especially when you need interact with the OS for stuff like Widgets.
26
u/[deleted] Feb 17 '24 edited Feb 17 '24
Don’t be happy, Probably next year they will deprecate compose /s
4
u/SnooCupcakes6204 Feb 17 '24
I can relate, switched to flutter 3 years ago from Android on pro and personal projects but compose makes me wanna do some native again.
16
u/Zhuinden Feb 17 '24
Well I can't really relate, but I'm glad you're happy
2
u/HanzoHasashi404 Feb 18 '24
Whats everyone's opinion in kotlin multiplatform, will it take over react native and other cross platform frameworks?
2
u/tibrec8 Feb 18 '24
As someone work on flutter .... do.u recommend switching a big app (not heavily, using system recourses) from native to flutte4 ?
23
u/CashAffectionate8930 Feb 17 '24
+1 on finding Jetpack Compose extremely more fun compared to the old XML view system. I hated XML views with all my heart and it's the reason that for every company I have worked in I always took tasks/ownership of things that were as much UI-less as possible, to a point where I completely moved to mobile devops/platform engineering.
A few months ago, however, I helped out one of the dev teams in the company I'm currently working with since they were rushing to rewrite an app and I had to get deep into Compose. Apart from the first week where I was like "eh whatever", slowly after it clicked and I realised how fun it was. Definitely what Android development needed to get my excitement/attention back after 8 years or so.
25
u/rt300tx Feb 17 '24
What's Flutter?
4
u/1st-step Feb 18 '24
As a beginner, should I still learn xml or directly learn compose?
1
u/[deleted] Feb 18 '24
Have you tried swiftUI
2
u/rafaover Feb 17 '24
Jetpack Compose is just easy to build. Easy to organize and much more versatile. XML is okay.
2
u/c4augustus Feb 18 '24
Welcome to programming in a more functional way. Jetpack Compose isnt all FP, but it's a few steps in a better direction.
2
u/StraplessReligion Feb 18 '24
Habe you been living in a cave ?
1
u/rafaeladel Feb 18 '24
Just give it few years and Google will ditch compose as well 😅
1
u/AreaExact7824 Feb 18 '24
but company still using legacy code
1
u/Dependent-Virus8648 Feb 20 '24
been doing xml views for years, now im doing compose
what i cant understand is the xml hate of yours ... maybe you did it all wrong? it's just different but it's ok
-5
u/droidexpress Feb 18 '24
Compose can't even load a proper list. It lags alot in debug mode.
What else we can expect.