I have an app with about 20 xml layout files. Altough having spent quite some time to make a generic constraint layout for all devices (which was not possible for me), I now want to create an individual layout file for phones, small tablets and big tabelts. So I will have have 20 layout files for phones (5' - 6.8' display), small tablets (7' - 9' display) and big tablets (more than 9' display).
My question is, where shall I store them such that Android automatically picks the correct layout depending on the used device? In this question Layout for tablets in Android it is said that I should store the xml layout files in
res/layout/main_activity.xml # For handsets (smaller than 600dp available width)
res/layout-sw600dp/main_activity.xml # For 7” tablets (600dp wide and bigger)
res/layout-sw720dp/main_activity.xml # For 10” tablets (720dp wide and bigger)
or
res/layout/my_layout.xml // layout for normal screen size
res/layout-small/my_layout.xml // layout for small screen size
res/layout-large/my_layout.xml // layout for large screen size
res/layout-large-land/my_layout.xml // layout for large screen size in landscape mod
However, I can't distinguish the devices by their pixel density because different devices with the same display size can have different resolutions. Further, I would like to make the 20 xml layout files not for one specific size but for ranges of display sizes (otherwise I'd have to create too many xml layout files).
How can I define folders for storing xml layout files for ranges of display sizes: phones (5' - 6.8' display), small tablets (7' - 9' display) and big tablets (more than 9' display).
Reminder: I'll appreciate every furher comment as I still don't know what to do