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.
@mahmoudalkateb20082 күн бұрын
I have been watching your tutorials since they 1, you are the best android mentor out there on KZbin. 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!!!
@HoussamElbadissi17 күн бұрын
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.
@yewo.m16 күн бұрын
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
@josua_htp16 күн бұрын
can’t believe it’s been 4 years. feels like it was yesterday
@eonarma17 күн бұрын
what is the shortcut that he uses to move a block of code inside of another block? like in 7:22
@lg.studio17 күн бұрын
I also would like to know ....
@comandantety17 күн бұрын
ctrl + shift + ⬆/⬇
@eonarma17 күн бұрын
@@comandantety thank you!
@ShivamVermaokdone14 күн бұрын
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;;;;
@stevenray873717 күн бұрын
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-g1q2 күн бұрын
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ъ17 күн бұрын
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.
@alirahimpour8917 күн бұрын
The last one is possible with intrinsic height if I understand the problem correctly
@LeelaSlayys17 күн бұрын
For 6) Set intrinsic height modifier to the parent row and maxheight for the button. It should work as far I remember.
@HoussamElbadissi17 күн бұрын
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ъ17 күн бұрын
@@LeelaSlayys I tried to do like you said , I even used conslain layout for compose, but unfortunatelly it doesnt work for me
@Masycode17 күн бұрын
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.
@karolkulbaka857716 күн бұрын
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.
@MXC1916 күн бұрын
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.
@KnightKeeper15 күн бұрын
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
@akshat86015 күн бұрын
Heard of proguard?
@jackli192414 күн бұрын
You may add much more large size libs
@Rajmanov13 күн бұрын
you don't know what are you doing
@HinakaJingen15 күн бұрын
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-k8x17 күн бұрын
Jetpack Compose is not based on XML not even on a low level.
@-_-__.17 күн бұрын
If you think about that deeply,its not positive point its negative point 😅
@PhilippLackner17 күн бұрын
Your Compose UI is using a ComposeView under the hood which draws stuff on a canvas
@marcopinedo236817 күн бұрын
@@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
@HoussamElbadissi17 күн бұрын
@@PhilippLackner I mean, that's how _any_ UI library gets to draw stuff on Android, whether it's Compose, Flutter, or Unity.
@HoussamElbadissi17 күн бұрын
@@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_16 күн бұрын
For new projects, is there any case where the use of XML is a better choice?
@RezaZarchi16 күн бұрын
15:07 really? Is Jetpack compose based on XML? 😳
@សម្បត្តិដាណែត17 күн бұрын
I want to buy your course but it's too expensiive in my country
@XxNinjaLimeXX17 күн бұрын
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?
@memes69pk4717 күн бұрын
Whole android development sucks but i don't know why i love it
@doke605716 күн бұрын
I didnt but didnt you just change shortcut ? There selection thing iirc with alt+... That change many shortcut.
@saranyam988415 күн бұрын
May I know your android studio theme😊
@tylerwilson302713 күн бұрын
Related: JetBrains porting it for iOS, Web and Desktop has been a game changer for my work...
@德胜李14 күн бұрын
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.
@ajaygupta316010 күн бұрын
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Күн бұрын
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.
@ragingFlameCreations17 күн бұрын
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.
@HoussamElbadissi17 күн бұрын
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)
@ragingFlameCreations17 күн бұрын
@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
@mjdoesathing17 күн бұрын
Tried to enroll in the masterclass but got a 403 response
@PhilippLackner17 күн бұрын
Might be a network/country issue, do you have the chance to use a VPN?
@mjdoesathing17 күн бұрын
@@PhilippLackner Possibly because I'm in Hong Kong. I'll give it a shot with a VPN
@mjdoesathing17 күн бұрын
@@PhilippLackner That solved it. Thanks for all the good work, buddy, keep it up!
@robchr16 күн бұрын
Modifiers are like matrix multiplications. Order is from right to left.
@mohitg45215 күн бұрын
flutter took off so much why is jetpack is so behind ,is it relly worth it
@denisdavidek17 күн бұрын
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.
@vibovitold17 күн бұрын
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.
@devatrii17 күн бұрын
@@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.raflyyanuar988616 күн бұрын
I can't do check out on your course. It says 403 forbidden.
@basementdweller600013 күн бұрын
Use vpn
@-_-__.17 күн бұрын
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
@hdkloh16 күн бұрын
Animations became easy in Compose. Entire adapter class concept got killed in Compose
@UmerFarooq-vk9be16 күн бұрын
Compose preview is also bad. No hot reload feature yet
@PhilippLackner16 күн бұрын
@@UmerFarooq-vk9be the preview has massively improved, it's pretty good nowadays
@KlllHEAD17 күн бұрын
Plz bring discounts for the courses bundles and plz take Indian rupee of euro for Indians
@pr0adam17 күн бұрын
@hdkloh16 күн бұрын
Constraint Layout Visibility GONE is missed out
@rifatkhadafy978617 күн бұрын
i will migrate to compose if tag compose in stackoverflow reach 100k :)
@tasty-science-channel17 күн бұрын
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
@djknight0017 күн бұрын
Point 2 can be frustrating
@quantumgaming717 күн бұрын
It can be handled programmatically but of course it should be handled natively
@heihitesh17 күн бұрын
Bro, I am still using XML and Java 😅
@roman7171717 күн бұрын
It's time to leave that company lol
@victorlapin208017 күн бұрын
custom ROM development? =)
@pr0adam17 күн бұрын
cringey
@D3vCansado16 күн бұрын
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.
@roman7171716 күн бұрын
@@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-j6f3 күн бұрын
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
@memes69pk4717 күн бұрын
Whole android development sucks but i don't know why i love it
@hamuelagulto79616 күн бұрын
i dont have a problem with side effects. i dont think it's unintuitive
@abderrahim317 күн бұрын
This is literally ReactJs in disguise 😆
@devrb362917 күн бұрын
Flutter is better still for ui
@patricktaylor761417 күн бұрын
Fourth
@samarthvarshney51217 күн бұрын
Android is a dead end at least when it comes to Indian job scenario don't waste your time here.
@doke605716 күн бұрын
Why ? with your numbers, shouldnt Android dev being searched ?
@saimyusuf215214 күн бұрын
In India its not about anything, its just about money. If you can throw anything at free or dirt cheap you can get along