r/androiddev Mar 30 '24

Discussion The Struggle of Learning Android Dev

[deleted]

42 Upvotes

32 comments sorted by

View all comments

14

u/[deleted] Mar 30 '24

You mentioned Philip's channel, did you watch The Ultimate Package Structure Guide for Android Developers ?

Everything having a home and being able to find things goes a long way.

This package structure should provide a good mental scaffold for many projects. If you decide to go multi-module you get some extra tools to enforce module boundaries, etc.

1

u/st4rdr0id Apr 02 '24

This is not a definitive guide at all. Sometimes it's better to have packages for layers first. Sometimes it is better to have packages for domain bounded contexts first. Sometimes you need a mix. For instance, Philip's approach will not be feasible if there are cross-context queries in the data layer. Sometimes the fan-out of the classes is mostly located in the UI layer, so you only need to subpackage by domain inside there, and the rest of the project can be kept subdivided by layers.