The Top 5 Practices That Make My Android Architecture More Scalable

  Рет қаралды 19,299

Philipp Lackner

Philipp Lackner

Күн бұрын

Пікірлер: 25
@xAngel03
@xAngel03 5 ай бұрын
1. Dependincy Injection 2. Testing 3. Modular Design 4. Avoiding In-Memory Global State 5. Packge Structure Consistency
@Nek_12
@Nek_12 6 ай бұрын
That feeling when you said you should avoid global state and 10 seconds ago you showed that you had a private mutable var connectedNode that had a race with other coroutines.
@PhilippLackner
@PhilippLackner 6 ай бұрын
Global state is not dangerous if it's automatically re-assigned after process death which is the case for this connected node. If the process dies and is then recreated, we'll have to re-establish the connection anyways. I've also explained that in the course. Not sure which race condition you mean there regarding connectedNode.
@Nek_12
@Nek_12 6 ай бұрын
​@@PhilippLackner The wear messaging class sends messages using connectedNodeId which it will overwrite when you call connectToNode multiple times, causing messages to be sent to the wrong node. The design was supposed to observe and map the current node to a connection flow to prevent multiple clients from using it simultaneously. Your point about the local state is valid, the issue is how you manage it...
@aamirhoda7363
@aamirhoda7363 6 ай бұрын
One Question though about "Consistent Package Structure" -- As we have structured packages based on features, then my question is, if my "admin_override" feature has a couple of very small features that open up different screens as follows: 1. setting "printers" config through a screen, 2. showing "system_logs" through a screen, 3. "admin_override" screen itself for setting a couple of values/settings for the app to use; then inside "admin_override" package, should I create sub-packages called "system_logs" & "printers" which will further contain the usual "data", "domain", "presentation", "di" packages; as well as "data", "domain", "presentation", "di" packages in "admin_override" package as well ??? admin_override |__data |__domain |__presentation |__di |__system_logs |__data |__domain |__presentation |__di |__printers |__data |__domain |__presentation |__di 👆 For Consistency ??
@PhilippLackner
@PhilippLackner 6 ай бұрын
That quickly results in package hell :D Don't make it more complex than it needs to be. If you feel like system logs and printers are part of the admin override feature, include them in the corresponding layer packages
@JocelinoFernandes-l4j
@JocelinoFernandes-l4j 6 ай бұрын
Global state is dangerous, I had to rewrite my code to use local preference instead. Because process death caused app crash. I was tempted to use savedInstanceState to update global state, but I just decided in the end local preference aproach.
@jinde5566
@jinde5566 5 ай бұрын
I was using DataStore and combine with workflow that need Global state in UseCases
@snb_officall
@snb_officall 6 ай бұрын
hi Philip, I recently saw a program like crypto steps there to sell sneakers and pay for steps there they asked me for money to start and I deleted it now I can’t find a similar application, could you show me how to make one feature from there? it showed in 3D the real position of the phone in space, not only rotation, but in full from height to tilt, please, I am subscribed to you
@renvzla
@renvzla 6 ай бұрын
Philip, very nice video. Quick question, does it make sense to have a folder/package with only one file inside? for example, the mappers folder has only one file "DeviceNodeMapper".
@tch.777
@tch.777 6 ай бұрын
Amazing like always, ty ❤
@shahar19971
@shahar19971 6 ай бұрын
In case you need global state for contacts Would you use state flow like in your example, or save that into room/datastore?
@MrPDTaylor
@MrPDTaylor 6 ай бұрын
Phillip, do you know Timo Boll?
@PhilippLackner
@PhilippLackner 6 ай бұрын
Legend
@itscooldawgdonteventrip
@itscooldawgdonteventrip 6 ай бұрын
Just read job offers and learn that . Testing , solid principle , kotlin , jet pack compose and so on.
@sureshsivalingam01
@sureshsivalingam01 6 ай бұрын
Hey philipp or anybody know. In Android essential bundle course. I need some clarification which is lifetime access and which is limited time access?
@PhilippLackner
@PhilippLackner 6 ай бұрын
@@sureshsivalingam01 they're all lifetime access
@sureshsivalingam01
@sureshsivalingam01 5 ай бұрын
Thank u
@androidpc9656
@androidpc9656 6 ай бұрын
What if the globol state should not persist only live until the app closes?
@kivan26
@kivan26 6 ай бұрын
All the data should be accessed the same way, trough repositories. It is a repository implementation detail whether the data is stored in DB, file, rest api, shared prefs, or even in memory...
@snb_officall
@snb_officall 5 ай бұрын
Hi philip, could you show how to make one feature? it showed in 3D the real position of the phone in space, not only rotation, but in full from height to tilt, please, I am subscribed to you
@littlebitofeverything237
@littlebitofeverything237 6 ай бұрын
Thanks!
@MrPDTaylor
@MrPDTaylor 6 ай бұрын
Guten tag
@MrPDTaylor
@MrPDTaylor 6 ай бұрын
Ich bin ein Berliner
@MrPDTaylor
@MrPDTaylor 6 ай бұрын
Third
MVVM vs. MVI - Understand the Difference Once and for All
18:40
Philipp Lackner
Рет қаралды 55 М.
Какой я клей? | CLEX #shorts
0:59
CLEX
Рет қаралды 1,9 МЛН
Why Use Design Patterns When Python Has Functions?
23:23
ArjanCodes
Рет қаралды 113 М.
Why I'm choosing FLUTTER in 2025! | Flutter roadmap 2025
13:40
This Is My FAVORITE Error Handling Class
28:57
Philipp Lackner
Рет қаралды 36 М.
7 Outside The Box Puzzles
12:16
MindYourDecisions
Рет қаралды 16 М.
FULL Guide to Kotlin's Inline Keyword (inline, crossinline & noinline)
16:35
ViewModels & Configuration Changes - Android Basics 2023
18:46
Philipp Lackner
Рет қаралды 139 М.
Microservices explained - the What, Why and How?
18:30
TechWorld with Nana
Рет қаралды 905 М.
20 System Design Concepts Explained in 10 Minutes
11:41
NeetCode
Рет қаралды 1,1 МЛН
The Top 3 State Management Mistakes On Android
14:30
Philipp Lackner
Рет қаралды 26 М.
Какой я клей? | CLEX #shorts
0:59
CLEX
Рет қаралды 1,9 МЛН