Modern Android development: Android Jetpack, Kotlin, and more (Google I/O 2018)
Вставка
- Опубліковано 9 вер 2024
- The last couple of years have seen a plethora of new features and patterns for Android developers. But how do developers know when to use existing APIs and features vs. new ones? This session will help developers understand how they all work together and learn what they should use to build solid, modern Android applications.
Rate this session by signing-in on the I/O website here → goo.gl/TSwGKh
Watch more Android sessions from I/O '18 here → goo.gl/R9L42F
See all the sessions from Google I/O '18 here → goo.gl/q1Tr8x
Subscribe to the Android Developers channel → goo.gl/GEh1ds
#io18 #GoogleIO #GoogleIO2018
The Architecture Components are really fun to work with
haha didn't expect to run into you here. I like your lessons
It is surprising how he has the ability to make it sound like French when he is speaking in English.
He was speaking English O_o?
I've heard English in Britain that was far less comprehensible. Just gotta pay attention in this case.
Just because his mother language is French.
He's more likely to actually make the Android framework simpler and more comprehensible, as well as actually make his ConstraintLayout editor actually work (it's full of bugs that make it almost unusable) than actually speaking understandable English
I love listening to him
These guys also have a great podcast
Name of the podcast?
We need this every year
This talk was not only really good, as it was really funny as well.
That huge fragment lifecycle diagram someone created is not even correct...
Despite some good points, I'm still not sold on the "single activity" approach. Quite on the opposite actually, since I learned Activities could be styled to look as dialogs and whatnot, I tend to prefer them over Fragments. It mostly has to do with navigation (e.g. screens started from notifications) and properly restoring the state.
Fragments are pretty good at properly restoring the state - hell, that's the one thing that they do really well.
A single activity app will honestly feel a lot better from a UX standpoint. All the apps I create try to have as few Activities as possible, and the end result is a lot better. When I use an app that uses that Activity A -> slide transition -> Activity B, it just hurts how old, and terrible that is.
Trust me, use Fragments as much as possible, it'll make the app feel a lot smoother. Fragments and BottomSheets.
It is good in conceptual but wouldn't it clutter a single Activity code so it be a maintenance nightmare? Idk
Prageeth Kumara one of our apps had around 21 screens and only 1 Activity, and the activity code was around ~150 lines total. All that logic you assume to be in the activity is either in a separate layer, or in the fragments.
Yeah, the Activity just contains the logic for replacing the Fragments, the Fragments know exactly what they're doing and can handle themselves. You can pretty much just convert all other Activities into Fragments, and then throw them into one Activity, and you won't have to change much in terms of code.
Nice video
Great talk even 3 years later
After the keynote, this is my favourite video so far. My apps generally have a lot of Activities, I had found it to be an easy way to handle UI changes, and many tutorials seem structured in this way. Is there a good source I can read that lean more to single activity applications?
Have you find anything? I'm looking for the same thing
I hope this helped : ua-cam.com/video/2k8x8V77CrU/v-deo.html
I enjoyed this talk
"Engineers will be unhappy with every new option you give them. Specially if they are french."
still remember the time during I"m developing for Android Jelly Bean.. The changes are so significant I can say... BTW, nice presentation format
38:23 Crickets.... :-D (probably not enough native English speakers in the room to appreciate your jokes!)
Moving I/O outdoor is really a dumb choice.
that absolute layout joke was great lmao
matching glasses on point
very excellent
Fantastic talk!
I built my first app 7 months ago, it is high time to upload it on the store :) going to do this tomorrow! I have it already on my smartphone. Name : Chat@Scale R-Control
congratulations mate, I am on the process of developing mine and will be uploading this coming 2019, cannot wait
Nice❤
Love these guys! nice talk!
Thanks for fixing fragments :)
Sounds Good
Great
too little too late, you should've done this a looong time ago, now iOS is light years ahead of Android
Isn't that new Paging Library (really a boring name) an extended version of DiffUtil?
If you disregard the ability to define a custom data source that can back itself from DB or from network to only load pages of data automatically and handle background thread writes to DB to re-fetch new data automatically, and load only pages asynchronously, while also providing a BoundaryCallback to handle when you ran out of data to show and should probably go fetch some more, then yes
Does anyone know what's brand of presentation remote these guys are using? Thank!
Really funny and informative talks :D
I didn't see any words about Jetpack in this video :O
No treble talk???? I/0 18
Need time breakpoints in comments
A spammers warns me that he will create my website as his android app and upload in play store. How can I stop the spammer and report to google??
语速好酸爽!😄
Single activity app hmmm, what about changing themes per screen, I usually have some translucent statusbar ui somewhere, id needto restart the app with single activity arch
activity.recreate()?
Zhuinden Restarting the whole app, recreating whole backstack for ui change
vlastos "whole backstack" is an overstatement, that's all Parcelable. You only need to inflate current view and it actually happens seamlessly. We've had to do it before. Although I think you can set theme on Api 21+ easily dynamically, but I do know that for example locale change within your app requires recreating the activity because the base context must be reconfigured and it is unavoidable no matter how many Activities you have. Except you'll have to tell ALL of them to die! That's when people hack with clear task new task instead :D
Surprised the design library wasn't in the timeline.
Single Activity application? No way! That’s just absurd.
I am from bangladesh..very nice sir
Hello..
R.I.P AbsoluteLayout. hahaha...
Wtf is with that enum pronounciation
Too much bla bla and the code on the slides is awful to read.
This talk shows just how bad Android is from a developer stand point.
Any elaboration for your strong opinion?
1. 12:02 They literally explain how it was a performance pattern to not use enums because their virtual machine was too bad. I'm sorry but it's depressing that not using enum's is a "performance" pattern in 2018 considering in that in the 70's (almost 50 years ago) you could use them as much as you wanted in C with 0 performance penalty.
2. 22:28 They literally show you the history of all the Layout types they created for Android and how most of them are bad and you should never use and that their new idea is now going to work. Except that is what they said about RelativeLayout back in the day, and before that about GridLayout and so on. The Android API clearly has a pattern of very very very bad choices.
3. 24:54 They literally show you just how horrible it is to do animations on Android because guess what, the API is so fricking bad.
4. 25:48 They literally joke about how stupidly hard it is to make a RecyclerView change its orientation.
5. 26:52 They tell you all about how Fragments for the longest time even they at Google had no idea how to use, how they deprecated their original implementation and how even now, they realize that it's complicated to work with them but hey you do what you have to do. I remember a few years ago watching a presentation from Google IO about Fragments and how in the beginning of the talk the guys presenting were like "Hey, so we know no one really uses Fragments because you have 0 idea how to and we understand you because we at Google also have 0 idea how to use them but good news, now we at Google now how to use them so we are going to show you. And sorry btw that we made it so bad in the first place." (I'm paraphrasing because I don't remember the original video).
6. 28:04 They said that in the past they wanted you to use a separate Activity for everything in your app but now they realize that doesn't work and you should use just one.
7. 31:20 They show a monster of a diagram of the lifecycle of a fragment and its not even complete.
8. 31:38 They explain how no one even overrides the lifecycle methods of an Activity correctly (maybe because their API and documentation is awful).
9. 31:56 They tell you how it is all their fault because instead of giving you the information about the lifecycle they apply OOP principles to try an encapsulate and hide it behind all those methods. Now they realize this doesn't work so they just give you an even more complex API which involves you creating another object called and LifecycleObserver. But please trust them that this time it's ok and they won't change their mind in a few years and deprecate this API.
10. 32:57 "Abstract it into this other thing over there..." yeah, cuz you know, this worked so great in the past.
11. 38:15 Well I wish I could "Minimize my memory consumption" but the fact that you choose a garbage language that can't allocate objects like iterators on the stack or in which enums are considered to have too big of a memory footprint, makes my life quite hard and miserable to develop for your shitty platform.
12. There are way more examples I could give but just by looking at random talks from Google IO you can find more. In one Q&A for example they asked the Android team why the Clear All apps button was removed in Android P and the head of the Android team sighed and said "I had the same question for the team and they just ..." and then they give the mic to a guy from the Android team who says "Yeah well we thought that Android should just handle memory management of the apps better and that you shouldn't need a Clear All button. Sorry for that, we are working on putting it back."
I'm not sure if you will read all of my points but it doesn't take a lot of time watching random talks from Google IO to figure out that Android has massive problems. It's APIs are a mess and has a whole history of bad choices, Java as a primary language was one of the worst decisions possible considering how slow Android is (and don't pull the "but Java is not slow" argument on me, when you have to avoid using enums (a thing that has the performance cost of an int in C) for performance and official apps from Google drop frames all the time.).
I know making an OS is hard, but the pattern of bad choices made by Google when it comes to Android is pretty clear. And it's sad that the most popular mobile OS is so bad.
As for your 1. to 7. , I see it with a quite different developer's view. If Android has stopped it's improvements over API and low level architecture, it would be a very boring OS and many could start to consider other career choices. The reason for the API changes is the magic word "powerful", that a simple function can do more things than expected. In a somewhat extreme case, everyone who begin writing opengl code ask the same question: why these 100 lines of code while my intention is very straightforward? Because it seems simple but actually not so, you are creating an object in a context, API implementation need your definition of object and context.
Yet another way to put it... mobile industry is highly mobile, to keep up with the mobility, things need changes. The talk basically goes like: some changes we made are good, and here are the wrong stuff that we are trying to fix and before it's done you may try this and that.
And for the Java argument, I think everyone could find the reason why Android adopt Java. To dominate the market, google choose a developer friendly and portable language. JVM is also good for security concern.
Coming from C# to Android, I find the endless deprecation to be a bit ridiculous. Just stick with something and make it better rather than constantly throwing stuff out in favor of a new miracle API that will ultimately be deprecated in 2 years for the next miracle API.
I really like Android and I think its a great system. However, I always had some struggle with animations, fragments, etc.. Basically everything you criticized. I always thought it was my fault, so it's nice to see that there are other people with the same problems :D (I am just a hobby developer btw.)
The endless deprecations, the hundreds of API levels to support and the millions of support libraries make building Android apps really painful and confusing, especially if you don't have a lot of experience.
I think the announcements from IO18 mark a good way to go (Jetpack, Android X and *finally* a material theme editor) but especially for beginners there are still a lot of questions to be answered. I'll wait for the first stable releases until I start my new project using the new features announced at this IO.
Romain Guy is so cute😍
Time to go full react native.
Native android development is dying, why would we learn kotlin?
I'm an iOS developer as well and I see that they are moving towards Xcode.
Xcode as nothing on android studio. Yes, they (xcode) may have some good ideas, but android studio does them better
It is okay to adopt something better even though the android studio is good. The storyboard layout for navigating is something that has been adopted. One of the examples is constraint layout.
True, storyboard is quite cool, although it can get quite cluttered for large projects. The constraint layout on xcode was hard for me to learn compared to the android one. Everyone I know who has used both professionally agrees that android studio is a better experience (except for the build times on the emulator).
I'd blow my brains out if I had to use xcode.
You will be left with no choice then.
Hey Google, don't spam my feed. XD
Sorry, I can't help you with that yet.
Instead of going to Kotlin, it would have been better for you to switch to modern C++ instead
whaaaa'
? oO ? O_o
heavens no
witty humor
Bye Java !
I'm watching this video so that Google will hire me as a Android developer.
**insert That's not how it works.jpg**