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

dave

02/06/2019, 8:46 AM
hallo guys, have any of you used Android Architecture Components? Would you advice to use it? What's the most commonly used architecture in Android nowadays?
So far I'm an MVP guy, but would like to try AAC
g

ghedeon

02/06/2019, 8:54 AM
#android-architecture
👍 4
r

rkeazor

02/06/2019, 12:43 PM
MVP a d MVVM
j

Jeremy

02/06/2019, 8:56 PM
How do you handle config changes w/ MVP?
d

dave08

02/07/2019, 3:42 AM
There's a lib for MVP you could try: https://github.com/grandcentrix/ThirtyInch/
🤔 2
m

McEna

02/07/2019, 2:14 PM
folks, he's asking about the google libraries, not just patterns
d

dave08

02/07/2019, 2:14 PM
He also asked:
What's the most commonly used architecture in Android nowadays?
m

McEna

02/07/2019, 2:14 PM
"hallo guys, have any of you used Android Architecture Components? Would you advice to use it?"
@dave I would say Workmanager and lifecycle awareness are the better investments. While other things like Room have tons of valid alternatives and approaches, Workmanager's main competitors "are" Jobscheduler/FirebaseJobdispatcher, but turns out workmanager uses those two under the hood dependening on the scenario. Evernote's android-job does the same. Dealing with the lifecycle is one of the main tasks you'll have, so having a single way to do it across the app helps (again, we'd been doing it for years with no problem in several ways, but there isn't a "main" solution).
Regarding patterns, Google's Architecture components are oriented towards MVVM, although of course you can use them with your preferred pattern.
g

ghedeon

02/07/2019, 2:45 PM
WorkManager is a good investment untill they introduce WorkWorker. I believe the next failed attempt will be called
WorkWorker
because
AsynkTask/JobScheduler/Loader
is already taken.
🤣 1
🙈 1
c

czuckie

02/07/2019, 2:49 PM
it is a serious ballache dealing with life cycle issues- turning on don't keep activities and disabling background processes just unleashes the pain
d

dave08

02/07/2019, 2:53 PM
Some prefer MVP over MVVM, and I think that lib uses Lifecycle under the hood anyways... I personally want to look into MVVM, but MVP is a pretty simple pattern for less complex apps and it works well.
☝️ 2
j

Jeremy

02/07/2019, 3:41 PM
To better answer question yes I have successfully used AAC LiveData, ViewModels in large prod apps. People have been equally successful w/ a wide variety of other patterns/libs also
👍 1
Your activity/fragment is a view binder. Don't use it for anything more such as retain state, business logic etc and 99% of your Android lifecycle issues and related issue such as memory leaks will go away
d

dave

02/08/2019, 7:53 AM
Hi guys, thanks a lot. I'm currently using MVP but I'm questioning it since AAC approach is sort of MVVM. I will dive into AAC, for now Navigation, ViewModel, LifeCycle. Let you know soon how it goes.
👍 1
2 Views