deltachat / deltachat-android

Email-based instant messaging for Android.
GNU General Public License v3.0
1.11k stars 144 forks source link

organize project structure #3127

Closed adbenitez closed 3 months ago

adbenitez commented 3 months ago
r10s commented 3 months ago

these are the defaults for android projects, right?

github-actions[bot] commented 3 months ago

To test the changes in this pull request, install this apk: 📦 app-preview.apk

r10s commented 3 months ago

but is it really default to put res into src dir? if so, then it's that, just wondering.

apart from begin default, what is the advantage of the now longer paths? that we can more easily adapt for flavours in the already know way? are there other advantages?

just because of interest, iirc, it took me some effort years ago to go for an alternative app-icon that includes the word "DEV" ...

r10s commented 3 months ago

just because of interest, iirc, it took me some effort years ago to go for an alternative app-icon that includes the word "DEV" ...

ftr, that seems to use the same approach as now everywhere, see documentation in src/debug/README.md - i think, we can then delete that file alltogether, this is now obvious and standard

adbenitez commented 3 months ago

but is it really default to put res into src dir? if so, then it's that, just wondering.

yes, in fact that is what the debug folder is already doing to override the app icon, it might sound confusing at first because you might thing of src as code, but it is more like all your app sources and content, and it is more clear when you see the flavor folders inside, then each flavor can have its own res, assets, AndroidManifest and java code

you can see a common project structure creating a new project in Android Studio, the common thing is to wrap the src folder inside an app folder but that seemed to add more complexity, since you then need to have a top level build.gradle plus another one inside app folder etc

you can see an example project tree at https://developer.android.com/build

adbenitez commented 3 months ago

apart from begin default, what is the advantage of the now longer paths? that we can more easily adapt for flavours in the already know way? are there other advantages?

not much, other than being in the standard place were other android developers would expect, and in the same level as alternative res/assets for other flavors also to reduce the clutter in the root of the project, less folders and files from the app source spread together with config files etc