I am currently developing an app and I am using
I added the sw400dp folder, which basicly takes all the smaller phones according to Android Studio's XML renderer. Which means it overrides the layout folder. So
Only for devices whose smallest width is 400dp or greater. 400dp is 2.5in or 6.35cm. I would estimate that there are a couple hundred million Android devices in use whose smallest width is smaller than that.
Have I gone about this wrong? Should sw400dp be the layout folder and build bigger layouts in their own folders?
Probably. You would only have a
res/layout-sw400dp/ directory if you have layout resources that need to be different for devices whose smallest width is 400dp or greater. Most of your layout resources will not need to be different for that specific size, which means the version of the layout resource in
res/layout/ would be enough.
Or can I delete the layout folder without issues?
No, because then your app will crash on devices whose smallest width is less than 400dp.
The rules are simple:
Put one of every layout resource in
Put modified copies of layout resources in other directories if they need to be different for the criteria specified in the directory name
So, unless you clearly need different layouts for 400dp-and-wider devices, when compared to smaller-than-400dp devices, you would not need