0

I am new to programming and I didn't quite understand the dimens, I know there are small, normal, large and xlarge screen sizes. I also know the densities: ldpi, mdpi, hdpi, xhdpi, xxhdpi, xxxhdpi.

I see that we make dimens.xml for each size but I don't know how that works, should I make dimens.xml folder for all screen sizes then for all densities? and How can I know the correct dimensional values ​​for each size/density?

one last question, I want to work on normal size screen with mdpi, which one of those should I choose? enter image description here

  • https://github.com/intuit/sdp checkout this library for creating UI responsive on all device screen sizes. – Malik Bilal Nov 27 '21 at 15:37
  • 1
    "I see that we make dimens.xml for each size" -- not necessarily. "should I make dimens.xml folder for all screen sizes then for all densities?" -- no. Your dimensions should be in density-independent units (`dp`, `sp`, `in`, `mm`), so you would not need to have different `dimens.xml` files based on density. "How can I know the correct dimensional values ​​for each size/density?" -- talk to your graphic designer and see if they want different sizes for certain values (such as margins) based on different screen sizes. – CommonsWare Nov 27 '21 at 15:42
  • "I want to work on normal size screen with mdpi, which one of those should I choose?" -- none of those match your request. Bear in mind that `normal`/`mdpi` devices would be rather uncommon today. – CommonsWare Nov 27 '21 at 15:43
  • @CommonsWare thanks for respond, can I know which of the devices from the photo in my post do you recommend me to work on? – HOWDY WORLD Nov 29 '21 at 16:20
  • The one that is checked (Pixel 2) is not a bad choice, at least for your initial work. – CommonsWare Nov 29 '21 at 16:42

0 Answers0