I want to display a square image in the background at 80% width of the device. Currently, I'm developing on a standard phone (MDPI) So from this page: https://developer.android.com/training/multiscreen/screendensities I have a 160dpi phone, I want my image to be about 2 inches, my image should have a resolution of 320x320 pixel. then the image @ 2x 640px and @ 3x 960px. For the moment, do I understand correctly?
But if I take a larger phone, 80% of the width may be 2.5 inches, my image is no longer large enough. Worse, 80% of a tablet represents a much larger size. On this page: https://developer.android.com/training/multiscreen/screensizes I understand they explain the size required for each screen size:
res/layout/main_activity.xml # For handsets (smaller than 640dp x 480dp)
res/layout-large/main_activity.xml # For small tablets (640dp x 480dp and bigger)
res/layout-xlarge/main_activity.xml # For large tablets (960dp x 720dp and bigger)
So should I use this? But it's Android specific development, does it exist in react-native? If not, should I no longer use the @ 2x and @ 3x images? or should I do :
res/layout/main_activity.xml # For handsets (smaller than 640dp x 480dp)
res/layout/main_activity@2x.xml
res/layout/main_activity@3x.xml
res/layout-large/main_activity.xml # For small tablets (640dp x 480dp and bigger)
res/layout-large/main_activity@2.xml
res/layout-large/main_activity@3.xml
...
For this particular image, it's a .svg format. I saw that I could convert it from .xml from android studio and open it with the svg library? Is this the best option? (the answers to the previous questions still interest me, I'm not sure I'll only have .svg files)
And finally, when we use the 3 images formats (icon.png, icon@2x.png and icon@3x.png), are they all in the final apk? If so, why not just use the larger format and downsize it for smaller density screens?
I would have thought that these questions questions must be quite frequent, but impossible to find a clear answer...
Thanks