This talk is my go to #1 talk from this channel. I keep coming back and always learn something new every time I rewatch and refactor my code.
@adamhurwitz5 жыл бұрын
ViewModel - 10:45 Using .collect{ … } and .emit( … ) - 11:33 LiveData builder .asLiveData() - 11:45 .onStart{ ... } - 12:25 Replace LiveData switchMap - 13:00 Repositories - 13:20 Emit multiple values with flow{ ... } - 15:53 Working with non coroutine streams - 16:21
@mochadwi5 жыл бұрын
thank you very much for this summary @Adam Hurwitz
@ringoaikocascade4 жыл бұрын
Would like to talk about testing but we don't have much time - 17:22
@yallam084 жыл бұрын
This testing joke at the end is hilarious 😂
@SociedadAndroide4 жыл бұрын
This was amazing !! Thank you guys now I know how to use flow :) Keep up the great work!
@marlonlom5 жыл бұрын
Great review about livedata ando coroutines... After a year sharing similar topics
@codingwithmitch5 жыл бұрын
Are there any samples on github?
@RaymondChenon4 жыл бұрын
Sample with liveData. No Flow yet github.com/android/architecture-components-samples/blob/master/LiveDataSample/
@TheHiddenAndroid5 жыл бұрын
Congrats to Yigit and Jose for a nice session! Just a bit silly that we have naming discrepancy in that we have lifecycleScope and viewModelScope but liveData {} is missing Scope suffix :/ And Jose, well done for lingering in the KZbin comments...
@josealcerreca48415 жыл бұрын
liveData launches a coroutine. The Scopes are just scopes that need `.launch` to launch the coroutine. Completely different things :)
@igorg.86245 жыл бұрын
Where are the Google samples for using Flow in android apps?
How can i unit test a method that contains a reference of a Flow thas is converted to a LiveData using the function 'asLIveData()' ????
@bjugdbjk3 жыл бұрын
quite informative and lively presentation. I tried this scenario, Having a flow emitter in the datasource and taking into the livedata in the Viewmodel and question is when I am observing this livedata in the activity and when app goes to background and come back to the foreground, flow is restarting again and it's not getting paused?
@benlu35235 жыл бұрын
What a nice “Rx Java”
@josealcerreca48415 жыл бұрын
Nothing wrong with that!
@robkeazor97095 жыл бұрын
You mean Flow? because Livedata is pretty different than RxJava
@cheesuscheetos40765 жыл бұрын
Flow is a reactive component, it is indeed made as an answer to RxJava. One of the most beautiful things about Kotlin and JetBrains in general is that they really care about consistency and having in house solutions. For them having to use a third party library for something that they can implement themselves and is important is bad. This in turn makes the language feel syntactically consistent and a complete whole. Precisely this is the reason why so many of us love Kotlin. For me Kotlin Coroutines and Flow have so far been a complete hit that has addressed many problems and made concurrency, reactive programming and switching between threads so much more manageable, readable, understandable and easier.
@preetgandhi12334 жыл бұрын
@@robkeazor9709 Can you Please explain me the difference and when to use which? I am having a use case to fetch the Data from an API and show it in View no more UI to Database Interaction needed. So what should i use?
@wahyukoco45622 жыл бұрын
do we need to use live data instead of state flow in presentation layer?
@tubun095 жыл бұрын
is there any public repo example of this?
@JoseAlcerreca5 жыл бұрын
We have a sample using the liveData builder but since Flow is experimental it'll take some time to be in official samples. github.com/android/architecture-components-samples/blob/master/LiveDataSample/
@charlietapping45185 жыл бұрын
@@JoseAlcerreca Would be really useful if you could just post a GIST of how you would replace the repository liveData coroutine builder with flow, using the typical Room response whilst the network updates the db in the background
@josealcerreca48414 жыл бұрын
We used Flow in the ADS app: github.com/google/iosched/blob/adssched/mobile/src/main/java/com/google/samples/apps/iosched/ui/sessiondetail/SessionDetailViewModel.kt
@michaelnajera79585 жыл бұрын
17:51 What is this "caching behavior" that we lose if we ditch LiveData and just use Flow?
@yaroslavkulinich71555 жыл бұрын
Livedata holds the last state. So if you unsubscribe from livedata and then subscribe again, you will receive the last emitted value. In case with flow, you always receive new value from fresh request.
@michaelnajera79585 жыл бұрын
@@yaroslavkulinich7155 Thank you.
@karibui4945 жыл бұрын
@@michaelnajera7958 you can just conflate the flow and it gets the same caching behaviour .
@michaelnajera79585 жыл бұрын
@@karibui494 I think I'd actually prefer not to get the cached value. To me, it violates the "single source of truth". But maybe I'm missing something. Is there a benefit to this default caching? All "caching" should come from my repository and not from something I don't control.
@igorg.86245 жыл бұрын
@@yaroslavkulinich7155 I believe RxJava PublishProcessor does this
@lokthar63144 жыл бұрын
Why would you use a WorkManager if you want to do a Http Request such as sending a tweet? (5:37)
@lokthar63143 жыл бұрын
@Ray If your App is doing a request while it's killed then this sounds like your App is not behaving right. App closed -> No requests, unless you do something like location tracking.
@anupkunwar52905 жыл бұрын
At 6:46 and 7:15 how can we retry the operation?
@Rajmanov5 жыл бұрын
Super cool José!
@KhairulImam101005 жыл бұрын
I still having problem with testing my viewmodel that launches viewmodel corotuine scope and update livedata value inside that scope.
@JoseAlcerreca5 жыл бұрын
This is covered in today's testing talk!
@KhairulImam101005 жыл бұрын
@@JoseAlcerreca Cool!! waiting for it!
@alexneeky79205 жыл бұрын
Why flow feels like rx java with extra steps?
@benlu35235 жыл бұрын
Because it is a flow (flowable)
@dnkilic4 жыл бұрын
This is revolution!
@petrushoc5 жыл бұрын
Awesome presentation
@ViktorYakunin5 жыл бұрын
Flow APIs are very similar to Rx, what is next? adding library with extensions to clone all Rx functionality?
@hinocenciopaulo5 жыл бұрын
Do you are pissed because your Rx knowledges are irrelevant right now?
@ViktorYakunin5 жыл бұрын
@@hinocenciopaulo I'm using Kotlin in production since beta and Coroutines since experimental, so no. When you have a library (RxJava) that poisons all your codebase IMO its bad idea. But I must say that a lot of other technologies are on Rx stage, for example RxSwift, RxDart are there and Spring5 has async model as well that uses Rx too.
@Muthuraj5 жыл бұрын
Flow is similar to Rx, but the major selling point for that is, it is multiplatform.
@phamgiang91495 жыл бұрын
An additional point is that RxJava is a heavy library. Most of the time, developers don't use 99% of its power in the codebase :D
@igorg.86245 жыл бұрын
@@Muthuraj Is there anybody doing this type of multiplatform in production?
@marcopierucci45194 жыл бұрын
How about retry option?
5 жыл бұрын
Any flow video tutorial?
@help-ever5 жыл бұрын
Source code for the app will be available soon after I/O.
@saungaye97172 жыл бұрын
Imagine a life you don't know English much and try to understand this alien things.
@NikhilMaurya105 жыл бұрын
So livedata is also in the bin now. I like fast paced development but this is ridiculous.
@JoseAlcerreca5 жыл бұрын
Not in the bin at all! (Data Binding, Java users) but we thought it was interesting to show. Remember we didn't create or control the development of Flow.
@NikhilMaurya105 жыл бұрын
@@JoseAlcerreca I guess it was bound to happen since popularity of Koltin was/is through the roof.