I am building an app and I have about 20 Fragments that have XML layout files with Constraint Layout. Now I would like to create layout files for both phones and tablets. So I would like to have 3 version of each XML layout file:
- One XML layout file of each Fragment for Smartphones
- One XML layout file of each Fragment for Tablets with 8' display size and 1280 x 800 display resolution
- One XML layout file of each Frament for Tablets with 8' display and 1980 x 1200 display resolution
My question is how can I do that? I have to create the XML layout files for each of my Fragments but where shall I save them such that Android know which layout file to choose? I found some other question on Stackoverflow like this Android layout folders for different screen sizes or Drawable folder for 8 inch tablets. But here they only distinguish the layouts by the dp number. But when having 2 tablets with the same display size (in my case 8') and different resolution, the dp number should be different. How can I take this into account.
Reminder: Can't anybody say something about how to create layouts for different screen sizes and resolutions?