2
In the Android there are so-called "DPI", who are pixel densities. Each screen has its kind of DPI as an example:
Smartphones:
- layout [?]
- layout-ldpi [240x320 & 240x400]
- layout-mdpi [320x480 & 480x854]
- layout-hdpi [480x800 & 480x854]
- layout-xhdpi [720x1280]
- layout-xxhdpi [1080x1920]
- layout-xxxhdpi [?]
Tablets:
- layout-mdpi [600x1024 & 800x1280]
- layout-xhdpi [2560x1800 | 2560x1600 | 2048x1536 & 1200x1920]
- layout-tvhdpi [800x1280]
To each type of screen exists "folders" with picture sizes different:
- drawable
- drawable-hdpi
- drawable-large
- drawable-ldpi
- drawable-mdpi
- drawable-xhdpi
- drawable-xxhdpi
- drawable-xxxhdpi
My doubts are as follows:
1) In each layout folder, I create files with the same name as . xml to the screen. However how do I know that the android is using the screen in that particular DPI? It’s some code I have to insert to he use the layouts?
2) What is the use of the folder "layout" and "drawable" with the name "pure", without using for example "layout-ldpi"? In this same question, what are the sizes of the images in the folder "pure drawable" and "pure layout"?
3) Assuming I have to create a background, Landscape and Portrait at 800x600 resolution. The Portrait is 800x600 and of course the Landscape is 600x800. Should I create the background in these two resolutions? And how these images will be called correctly by Android?
4) Following the reasoning of the question (3), for each type of resolution, as I know what is the ideal px size for images like icons, "normal" images and others?
5) If I want to create specific "layouts" as examples for the type of dpi "sw600dp". What should I do?
6) Following the reasoning of the question (5), it is really necessary to create these types of custom "layouts", or only dpi that I mentioned above already cane?
7) How does creating layouts for tablets work? And how I make the "merge" of layouts" of tablets with those of the "smartphones" within the same Android project?
8) There are also folders of type "values", "values-v21", "values-V22". What are these folders and what should be inserted in each of them?
I thank you for your patience, and kindly follow the order of the questions so there is no confusion.
Related (perhaps duplicate?): How to support various types of screens/screens
– ramaral