Brilliant explanation and perfect example.Could you please make some more videos on TDD approach for an example like this or maybe cover unit testing and Mockito, that would be really helpful. Thanks. There is not a single good video on TDD in Android .
No there will be more! Going to build the entire app! I've just been incredibly busy lately and haven't had time to make more content. I will make more videos soon, don't worry!
hey I can't assign viewModel: CharacterDetailsViewModel = hiltViewModel() in detail screen , any ideas ? it says hiltViewModel is unresolved reference edit : No idea how it worked seems like newer navigation hilt dependency was problem.
I think the majority of the calls are GET requests, so I'm not sure if I can do that with this API. But the process under the hood is basically the same! Still need to give the network call some parameters and handle a response - you just define the URL differently in the service class!
Very cool tutorial bro, three questions 1.Repository should be in network? But you put it in app module. 2.network module is same Data module in google docs? 3.where we should put domain layer if we use clean architecture in multi module project? 🙏🙏
1. I left repository in the app module because that was specific to the implementation of using the network package. I want to turn that package into a full open source library, so having the repository in there feels too "heavy handed". 2. I don't think so, but I don't know what docs you are referring to. Again, I want to turn that package into a library, so I want to keep it as lightweight as possible. 3. I would probably keep this layer in the app module for simplicity and ease. Making its own module for it would probably be overkill imo, so just try to keep a clean package structure in your app module
The first and third questions I understood, but for the second question, I meant the Android Developer website, and whether multi-module programming in Android has a special packaging like the Clean architecture, or if it's just the parts that the developer themselves decides to transfer to their desired module with a custom name?
I see. I am personally a little unfamiliar with the docs you're referring to, but at the end of the day (in practice, at real companies) we often stray away from specific patterns at times because as your team and project grows, it gets harder to keep everything in alignment. As long as you have a clear enough structure, I wouldn't worry too much about it. Remember: at the end of the day, the users have no idea how your code is structured 😆 One thing I would say from experience though is "package by feature" if you are going to break out different modules. So, you wouldn't want one feature to be touching many different modules, like if you had your network models in on module, domain modules in another, and presentation (Composables) in another module. Instead, I would try to keep all of the code that your feature needs to run in the same module. Otherwise, it becomes a real big pain to try and move it if you need to.
If we consider app like instagram We have search feature, profile feature and home feature so : -Search Module .data layer .domain layer .presentation layer -profile Module data layer .domain layer .presentation layer -home Module .data layer .domain layer .presentation layer Like this? And tank you very much for your response.
Yes that is typically pretty helpful for larger teams because if you just needed to work on a feature, enhancement, or bug fix in one of those areas, you would only need to make changes in a single module. This would reduce your potential for introducing bugs in the other modules, speed up compile time, and this structure allows for good "ownership" amongst the developers i.e. the "search team" vs. "home team", etc. Additionally, there will be some things that overlap between modules, such as specific models, networking and analytics helpers, date formatters, etc. and all of the individual modules can import this "shared" module so each feature area has access to these standard helper classes/functionality. Does that make sense?
Wow, can you also explain what other's like MVI, MVP, MVC ? I would link those videos to all people who's asking what it is. Because your explanation is next level, it's so simple and logical.
I appreciate your support! I'm glad it makes sense :) other architectures accomplish the same thing with slight differences, but sometimes they matter more based on how your data is structured, how users interact with it, multiple data streams, etc. I want to make more content to finish this series, but after that I'm happy to dive deeper into architecture!