I've Used Jetpack Compose For 4 Years - Here's the Good and the Bad

Поділитися
Вставка
  • Опубліковано 9 січ 2025

КОМЕНТАРІ • 85

  • @HoussamElbadissi
    @HoussamElbadissi 19 днів тому +21

    The modifier order IMHO is a powerful thing.
    Yes, confusing at first, but once it clicks, it clicks forever, and you'll never wanna use anything else ever again.
    Modifiers are the reason Compose isn't tied to a "box model" like web, because it doesn't even have one! Everything is modifiers all the way down. No margins, because that's just one more layer of padding. Not outline, because that's just a second layer of border.
    For beginners, I remember one official video by the Android Developers channel that cleared it up for me, but unsure which one it was.
    In general, modifiers are applied just as you see them. The one at the very bottom is the innermost, while the one at the top is the outermost.
    Some modifiers like size modifiers can have tricky interactions when multiple ones are applied, but generally speaking you can force and override these from the top.

  • @mahmoudalkateb2008
    @mahmoudalkateb2008 4 дні тому

    I have been watching your tutorials since they 1, you are the best android mentor out there on UA-cam.
    I love Kotlin and jetpack compose ecosystem even tho I work with flutter but still play around with Jetpack compose in my free time, thank you for giving us this free content Phillip!!!

  • @yewo.m
    @yewo.m 18 днів тому +3

    I've mostly been a web developer (with React, etc), but I first learnt the basics of Android development when I was at school, using XML. I found it to have the same kinds of issues as using the HTML DOM directly on the web (needing to manually keep everything in sync, etc), so I wasn't particularly fond of it. But later on I tried Compose, which I fell in love with

  • @HoussamElbadissi
    @HoussamElbadissi 19 днів тому +3

    The rounded corners thing is so true xD
    I never worked with XML long enough to even be good at it (was a beginner to coding in general), but so many simple things like that stuck like a damn sore thumb at me, and I thought I was just dumb or something (thanks XML for the self-esteem)
    Clipping was one of the first things I tried with Compose, didn't even have to read the docs, with how Compose is (mostly) intuitive, it just showed in auto-complete, used it, worked, no issues!
    I think this is one of the main benefits Compose gets from not being based on XML; It draws its own content, and thus uses a totally different rendering model that makes the essentials stupid easy to achieve.

  • @josua_htp
    @josua_htp 18 днів тому +1

    can’t believe it’s been 4 years. feels like it was yesterday

  • @eonarma
    @eonarma 19 днів тому +6

    what is the shortcut that he uses to move a block of code inside of another block? like in 7:22

    • @lg.studio
      @lg.studio 19 днів тому

      I also would like to know ....

    • @comandantety
      @comandantety 19 днів тому +11

      ctrl + shift + ⬆/⬇

    • @eonarma
      @eonarma 19 днів тому

      @@comandantety thank you!

  • @ShivamVermaokdone
    @ShivamVermaokdone 16 днів тому +1

    HOPE PHILIPP READ THIS !!!
    as a second year collage student I left Android development and started java development,
    Reason :
    I am from India and startups here do not prefer native android developement and it is hard to get job by doing only client side native development.
    Hence I Decided to choose another harder path, the backend development with java and now focused on learning that;;;;

  • @stevenray8737
    @stevenray8737 18 днів тому +1

    I'm glad I made the effort to learn Kotlin and Jetpack, as it's lead to one of the most enjoyable programming experiences I've had so far. I would like to pursue a career in native android, but I'm not sure if one can do it with Kotlin and Jetpack alone; there's also Flutter and React: Native to consider, and not a lover of pursuing more than one technology at any one time.
    Come to think of it, when making offscreen bitmaps for custom drawing( made an old pseudo 3D-maze app ) I had this strange thing where I had to scale the bitmap coordinates by a factor of exactly 3 to display properly. While it seems to work one the devices I use for testing, I couldn't understand why.
    I've found workarounds, but sometimes getting a composable function to recompose can be downright awkward. And animations don't always happen as expected.
    But I think all the above might just be things that I'm doing wrong rather than issues with Jetpack itself. I certainly wouldn't go back to Java & XML for android dev.

  • @JaimeVázquez-g1q
    @JaimeVázquez-g1q 4 дні тому

    Hey Philipp, it would be amazing if you could do a tutorial on how to render video in jetpack compose, also considering drm protected content, what alternatives exist, etc... Your videos are amazing

  • @ЮрійБережний-с7ъ
    @ЮрійБережний-с7ъ 19 днів тому +19

    1. Bad preview. It is not always displayed even if everything is written correctly and you need to rebuild it every time.
    2. Navigation is not intuitive, worse than fragment navigation.
    3. Constant recompositions, which makes them difficult to catch.
    4. Some elements like ads, videos and others remain on View, which is why you need to use AndroidView.
    5. Long screen loading when opening the application.
    6. Some things seem impossible to do on it. For example, when there is a Row and you need to display two elements - a TextField and a button, and the button should be as high as the text field and square, you will see that the button is not even in height.

    • @alirahimpour89
      @alirahimpour89 19 днів тому +7

      The last one is possible with intrinsic height if I understand the problem correctly

    • @LeelaSlayys
      @LeelaSlayys 19 днів тому +1

      For 6) Set intrinsic height modifier to the parent row and maxheight for the button. It should work as far I remember.

    • @HoussamElbadissi
      @HoussamElbadissi 19 днів тому +5

      Some responses:
      1) True! Preview has always been a huge issue. Thankfully there's some progress on getting hot reload working on desktop, which is pretty fast and preserves state.
      2) Which navigation in particular? And in comparison to what? There's many solutions with downsides and upsides to each, so please specify more!
      3) Recompositions aren't a bad thing all the time, until they noticeably impact performance. But yeah, optimizing things is harder in Compose.
      4) And that's not an issue IMHO. There's libraries abstracting over these, not everything belongs in the core Compose artifacts. And remember, Compose is multiplatform, so some things should naturally be delegated to third-party libraries. In fact, the fact that Compose has such seamless interop with Views/Swing/UIKit is a pro point! But yeah, more official integration of these platform-specific APIs would be nice to see (like video, etc... but things like AdMob are third-party things outside of Compose's control).
      Another point is that Compose is mainly a UI library; it handles everything UI, but video is usually very tied to platform specifics and codec support (i.e. it's complicated), as well as WebViews which are also tied to the platform (and bundling a full web engine is not practical).
      5) This really depends on the device, and debug builds in particular are slow all around. On a low-end device, startup times are fine with Baseline Profiles, comparable to other view-based apps.
      6) That's possible! You might wanna learn a bit more about intrinsic measurements, as well as aspect ratio modifier. Generally speaking, _nothing_ is impossible to do UI-wise, and what you describe is super basic. Compose makes tricky and complex UIs easy, let alone this type of thing. (skill issue)

    • @ЮрійБережний-с7ъ
      @ЮрійБережний-с7ъ 18 днів тому +1

      @@LeelaSlayys I tried to do like you said , I even used conslain layout for compose, but unfortunatelly it doesnt work for me

  • @Masycode
    @Masycode 19 днів тому +6

    I went back to studying mobile programming with Jetpack Compose. I don't like XML, and the truth is that I feel very comfortable working with the API, and I want to become a professional to work in the area of ​​mobile application development with Compose.

  • @MXC19
    @MXC19 18 днів тому +7

    Why is bigger app size not mentioned as a disadvantage?
    I made a simple 1 activity app with Jetpack Compose, and the app size was around 25MB.
    But I made another app with at least 15 simple activities plus a few adapters & fragments, and it weighs almost 10MB.

    • @KnightKeeper
      @KnightKeeper 17 днів тому +2

      I’ve made apps with compose fully featured under 5 mb compose doesn’t really have that much size with progaurd on .. 25mb is way too much to blame the framework

    • @akshat860
      @akshat860 17 днів тому +1

      Heard of proguard?

    • @jackli1924
      @jackli1924 16 днів тому +1

      You may add much more large size libs

    • @Rajmanov
      @Rajmanov 15 днів тому +1

      you don't know what are you doing

  • @karolkulbaka8577
    @karolkulbaka8577 17 днів тому +1

    I like to ask experienced android developers about one thing that was introduced by google that make you think 'that was exactly what I needed'. Like a slap stright in face :D
    Does compose is answer for this question? Not sure, but I think it still might be.

  • @HinakaJingen
    @HinakaJingen 17 днів тому +1

    Jetpack Compose, like every declarative UI framework before it, does a great job of bridging the gap between Developers and Designers. The catch? You need a whole new mindset to keep that bridge from crumbling.
    Best of luck to all the Android devs stuck with outdated tools and expert beginners on their teams - you’re gonna need it. 😂

  • @RokPetek-k8x
    @RokPetek-k8x 19 днів тому +18

    Jetpack Compose is not based on XML not even on a low level.

    • @-_-__.
      @-_-__. 19 днів тому +2

      If you think about that deeply,its not positive point its negative point 😅

    • @PhilippLackner
      @PhilippLackner  19 днів тому +12

      Your Compose UI is using a ComposeView under the hood which draws stuff on a canvas

    • @marcopinedo2368
      @marcopinedo2368 19 днів тому +2

      ​@@PhilippLacknerI have used Compose Desktop and I've found that all components are rendered with the swing API. So Compose doesn't actually draw anything natively

    • @HoussamElbadissi
      @HoussamElbadissi 19 днів тому +1

      @@PhilippLackner I mean, that's how _any_ UI library gets to draw stuff on Android, whether it's Compose, Flutter, or Unity.

    • @HoussamElbadissi
      @HoussamElbadissi 18 днів тому +1

      ​@@marcopinedo2368 I'm not sure what your definition of "native" is, but Compose does its own drawing on desktop as well. Just like Android, it creates an AWT window (when you use the `Window` composable), creates a Swing "canvas" (unsure of the actual API's name), and takes over from there. From there on, Compose draws its own pixels through Skiko (Skia wrapper).
      Just like Android though, it can interop with Swing, so you could use Compose in a Swing app (e.g. see IntelliJ Idea plugins), and vice versa (to use some existing Swing component in a Compose app.
      Same applies to iOS (creates a UIKit canvas), and web JS/Wasm (creates an HTML element), and draws using Skiko on all non-Android targets.
      Note that interop isn't yet implemented for web targets yet.

  • @i_youtube_
    @i_youtube_ 18 днів тому

    For new projects, is there any case where the use of XML is a better choice?

  • @RezaZarchi
    @RezaZarchi 18 днів тому

    15:07
    really? Is Jetpack compose based on XML? 😳

  • @សម្បត្តិដាណែត

    I want to buy your course but it's too expensiive in my country

  • @XxNinjaLimeXX
    @XxNinjaLimeXX 19 днів тому +1

    welp..... i was starting to learn android studio and then alt+enter stopped working for importing modules/packages. restarted computer, new project, cleared caches, filly reinstalled software....... now when I hit alt enter it just prompts with "create extension function bla bla" wtf its infuriating
    I don't want to have to google around for every effing import I do. Anyone else experience this and have a solution?

    • @memes69pk47
      @memes69pk47 19 днів тому +1

      Whole android development sucks but i don't know why i love it

    • @doke6057
      @doke6057 18 днів тому

      I didnt but didnt you just change shortcut ? There selection thing iirc with alt+... That change many shortcut.

  • @saranyam9884
    @saranyam9884 17 днів тому

    May I know your android studio theme😊

  • @tylerwilson3027
    @tylerwilson3027 15 днів тому

    Related: JetBrains porting it for iOS, Web and Desktop has been a game changer for my work...

  • @德胜李
    @德胜李 16 днів тому

    I think there is no solution to the problem of modifier order. If you want a clearer expression order, you need a certain configuration file, which will be more troublesome.

  • @ajaygupta3160
    @ajaygupta3160 12 днів тому

    Hello Sir, I’m an aspiring Android developer working on a multi-module Jetpack Compose stopwatch app. I’m using a foreground service to manage stopwatch logic and display a persistent notification. However, the app gets killed by Android after a few minutes when I put running stopwatch in the background, causing the stopwatch to stop prematurely. Could you please suggest a possible solution to resolve this issue? please help. Please help.

    • @remast0ras
      @remast0ras 3 дні тому

      This is a constant issue for services running in foreground for extended periods of time. You will need ask the users to remove battery restrictions, which 50% of them at least won't do. Different settings are required per manufacturer so hold tight, you fell in a rabbit hole.

  • @ragingFlameCreations
    @ragingFlameCreations 19 днів тому

    There's still many core Android apis not supported. Recently i tried to implement an overlay view that will display over other apps, i actually had to use xml to create it.

    • @HoussamElbadissi
      @HoussamElbadissi 19 днів тому +2

      Compose is a UI library, not meant to replace platform APIs (nor is that even possible).
      For your use-case, you'll need to setup the overlay with XML, but you can then put a ComposeView inside it and write Compose code for the actual contents. Anywhere you can put views, you can use Compose (e.g. when you use setContent {} in your activity, all that does is set up a ComposeView at the root of your activity, then delegates drawing into it to Compose UI)
      That's why places where normal Views aren't supported, you can't use Compose UI. Examples are widgets/notifications, where we have Glade instead (built on Compose Runtime for state and recomposition etc..., but isn't the same as the usual Compose UI)

    • @ragingFlameCreations
      @ragingFlameCreations 19 днів тому +2

      @HoussamElbadissi I actually tried that but it kept throwing weird exceptions and research found out that there's an issue track for it. Apparently I'm not the only one experiencing such hopefully they'll fix it

  • @robchr
    @robchr 18 днів тому

    Modifiers are like matrix multiplications. Order is from right to left.

  • @mjdoesathing
    @mjdoesathing 19 днів тому +2

    Tried to enroll in the masterclass but got a 403 response

    • @PhilippLackner
      @PhilippLackner  19 днів тому +2

      Might be a network/country issue, do you have the chance to use a VPN?

    • @mjdoesathing
      @mjdoesathing 19 днів тому

      @@PhilippLackner Possibly because I'm in Hong Kong. I'll give it a shot with a VPN

    • @mjdoesathing
      @mjdoesathing 19 днів тому

      @@PhilippLackner That solved it. Thanks for all the good work, buddy, keep it up!

  • @mohitg452
    @mohitg452 16 днів тому

    flutter took off so much why is jetpack is so behind ,is it relly worth it

  • @denisdavidek
    @denisdavidek 19 днів тому +6

    I couldn't agree more with everything, good and bad. I hate the navigation part of the compose. I am still using routes for navigation, but I will switch to the object based one in the new projects.

    • @vibovitold
      @vibovitold 19 днів тому +3

      Navigation and Compose are two different Jetpack components. You can integrate them, but you can also use one without the other. Navigation is not Compose.

    • @devatrii
      @devatrii 19 днів тому +1

      ​@@vibovitold it doesn't matter most of the people would still use the navigation library thinking that it's part of the compose core. They won't care about "technicality"
      ps:
      I think compose navigation should be easier

  • @m.raflyyanuar9886
    @m.raflyyanuar9886 18 днів тому

    I can't do check out on your course. It says 403 forbidden.

  • @rifatkhadafy9786
    @rifatkhadafy9786 19 днів тому +1

    i will migrate to compose if tag compose in stackoverflow reach 100k :)

  • @-_-__.
    @-_-__. 19 днів тому +4

    I have done Android development using Java and XML 2 years ago and I can say that Jetpack Compose could be future but I see only one problem in that like you said about difficulty in finding performance issue,this is the thing which can make Jetpack Compose unusable because most of users don't bear even small amount of performance issue.I think Jetpack Compose will be like React Native or Flutter in future because bugs and performance issues are most important things to consider

  • @hdkloh
    @hdkloh 18 днів тому +1

    Animations became easy in Compose.
    Entire adapter class concept got killed in Compose

  • @UmerFarooq-vk9be
    @UmerFarooq-vk9be 18 днів тому +1

    Compose preview is also bad. No hot reload feature yet

    • @PhilippLackner
      @PhilippLackner  18 днів тому

      @@UmerFarooq-vk9be the preview has massively improved, it's pretty good nowadays

  • @KlllHEAD
    @KlllHEAD 19 днів тому +5

    Plz bring discounts for the courses bundles and plz take Indian rupee of euro for Indians

  • @hdkloh
    @hdkloh 18 днів тому

    Constraint Layout Visibility GONE is missed out

  • @tasty-science-channel
    @tasty-science-channel 19 днів тому +6

    Some pains with Jetpack from my experience:
    1. Slower than xml based and even flutter
    2. Non-transaction navigation. If you click really fast two times there will be two pages pushed into stack

    • @djknight00
      @djknight00 19 днів тому +2

      Point 2 can be frustrating

    • @quantumgaming7
      @quantumgaming7 19 днів тому +1

      It can be handled programmatically but of course it should be handled natively

  • @heihitesh
    @heihitesh 19 днів тому +14

    Bro, I am still using XML and Java 😅

    • @roman71717
      @roman71717 19 днів тому +6

      It's time to leave that company lol

    • @victorlapin2080
      @victorlapin2080 19 днів тому +2

      custom ROM development? =)

    • @pr0adam
      @pr0adam 19 днів тому +1

      cringey

    • @D3vCansado
      @D3vCansado 18 днів тому +2

      This is the reality for most companies. Even though Kotlin adoption is much better, there will always be some part of the codebase in Java. Majority of people here have never worked with Android (or programming in general) and think every project uses the latest API’s.

    • @roman71717
      @roman71717 18 днів тому

      @@D3vCansado Totally agree with Compose but Kotlin should be the standard now.
      most companies in Israel keep the support for old java based features and make the new ones in kotlin.

  • @babak-j6f
    @babak-j6f 5 днів тому

    please when you speak down your speed of your speaking ,because all students at all over the world watch your videos, that have another native language and don't understand your speaking by speed, thank you so much

  • @memes69pk47
    @memes69pk47 19 днів тому

    Whole android development sucks but i don't know why i love it

  • @hamuelagulto796
    @hamuelagulto796 18 днів тому

    i dont have a problem with side effects. i dont think it's unintuitive

  • @abderrahim3
    @abderrahim3 19 днів тому

    This is literally ReactJs in disguise 😆

  • @devrb3629
    @devrb3629 19 днів тому +2

    Flutter is better still for ui

  • @patricktaylor7614
    @patricktaylor7614 19 днів тому

    Fourth

  • @samarthvarshney512
    @samarthvarshney512 19 днів тому +1

    Android is a dead end at least when it comes to Indian job scenario don't waste your time here.

    • @doke6057
      @doke6057 18 днів тому

      Why ? with your numbers, shouldnt Android dev being searched ?

    • @saimyusuf2152
      @saimyusuf2152 16 днів тому

      In India its not about anything, its just about money. If you can throw anything at free or dirt cheap you can get along