https://kotlinlang.org logo
#android
Title
# android
s

sss

09/12/2017, 8:07 PM
hey - guys so we are beginning to refactor a LARGE project into kotlin. Wanted to ask general rules of thumb for 3 things : RxJava, Dagger and Architecture Components. Do you guys use them in the Kotlin world, or is there something built-in that's a better/idiomatic alternative ?
🎖️ 1
b

bachhuberdesign

09/12/2017, 8:36 PM
Yes, we use all 3 for a pure Kotlin app. RxJava + RxKotlin (extensions/helpers for RxJava)
2
k

kevinmost

09/12/2017, 9:00 PM
All 3 of those are still valuable in Kotlin. I use all 3 in all of my work in Kotlin
and we use 2 of those 3 at work in our app with mixed Kotlin + a ton of Java. Still trying to convince everyone to get onboard the Dagger train...
k

kagomez

09/12/2017, 9:08 PM
you should try Databinding library too
b

bachhuberdesign

09/12/2017, 10:00 PM
Yeah, databinding can be great -- just be careful that you are not putting too much logic in your XML. It can get out of hand really quickly if you aren't careful (and a nightmare for others to maintain)
a

Artem Ohanjanyan

09/12/2017, 11:14 PM
Why did you decide to refactor your project into kotlin?
😱 1
s

sss

09/13/2017, 6:55 AM
@Artem Ohanjanyan well we have loved kotlin for a long time ! (I have a proposal on kotlin scripting as well). But we have a large exisiting codebase, so was waiting for Google support - now that its here, have been planning this out.
a

Artem Ohanjanyan

09/13/2017, 8:33 AM
Kotlin seems to have good interop with Java
k

kevinmost

09/13/2017, 12:25 PM
Yeah, I wouldn't refactor a codebase to use Kotlin; one of the best parts of Kotlin is the interop. Our app would have taken months just to rewrite in Kotlin. The only reason we were able to start using it is because we were able to drop it in alongside the rest of the code. Even after almost a year of using Kotlin, we're only at 11.8% Kotlin, with 85.9% still Java apparently
d

deviant

09/13/2017, 3:02 PM
rxjava - coroutines+kotlin stdlib dagger - kodein
btw, migrating from dagger2 to kodein decreased build times twice!
k

kevinmost

09/13/2017, 6:45 PM
of course it did, now you're doing less at compile-time and more at runtime 😆
IMO it's still nice to have RxJava over coroutines because the API is common and standard (reactive streams) so other libs will implement them in a way that makes it easy for you to consume
d

deviant

09/13/2017, 6:49 PM
what other libs? with coroutines you can use any lib you want. because there are no specific api requirements
k

kevinmost

09/13/2017, 7:12 PM
I mean that more libs have adapter layers. Architecture Components, Room, Retrofit, etc, all have dependencies you can add that give you Observable wrappers around their classes