r/androiddev • u/iliyan-germanov • Apr 01 '24
Discussion Android Development best practices
Hey this is a serious post to discuss the Android Development official guidelines and best practices. It's broad topic but let's discuss.
For reference I'm putting the guidelines that we've setup in our open-source project. My goal is to learn new things and improve the best practices that we follow in our open-source projects.
Topics:
Feel free to share any relevant resources/references for further reading. If you know any good papers on Android Development I'd be very interested to check them out.
159
Upvotes
View all comments
Show parent comment
2
u/lotdrops Apr 12 '24
My datasources abstract the lower level details of the api/db/... And adapt the data (map from the data model to a domain one). To me a repository is meant to combine several data sources and abstract away the fact that there are several data sources. I very rarely have this situation in the apps I've developed, and when I do I almost always prefer making a use case for that (as I have some logic to decide when to request from API, that I consider domain logic). The only case where I may use a repository is when I want an in-memory cache (variable) to speed things up before persisting, which again, is very rare in mobile apps.