Good Explain by @Eric Oestrich:
Writing a medium to large Android app requires having code structure. In creating our latest Android development project, I came across a structure that has helped me out.
Java Code :
com.example
Contains all the adapters.
Contains any class related to signing a user in. I create a local account and having all related classes together is very handy.
Contains all classes related to data management such as ContentProvider and SQLiteHelper.
Contains all of my SQLite migrations.
Contains all fragments.
Contains helper classes. A helper class is a place to put code that is used in more than one place. I have a DateHelper for instance. Most of the methods are static.
Contains all interfaces.
Contains all local models. When syncing from an HTTP API I parse the JSON into these Java objects using Jackson. I also pull Cursor rows into these models as well.
Contains all classes for custom preferences. When creating the preferences I required a custom PreferenceDialog as well as a custom PreferenceCategory. They live here.
Contains all classes related to syncing. I use a SyncAdapter to pull data from an HTTP API. In addition to the SyncAdapter a SyncService is required, so I created a package.
Layouts :
- Activity Layout name start with activity_
- Adapter Layout row name start with row_
- Fragment Layout name start with fragment_