how to work with different dimension in android studio?

Question:

I would like to adapt my app created for each cell phone model. As I some it gets the text smaller on the screen and in others bigger, I would like to create a method where it adapts to the model of the cell phone that the person is… so that it is always the ideal size for that cell phone

I know it has to do with ldpi, mdpi, xxhdpi, etc. But I don't know how to generate this dimens.xml file.

Answer:

Hi, give a survey about screen densities. https://developer.android.com/guide/practices/screens_support.html?hl=pt-br this link is from the android documentation and addresses this issue.

Just a little summary: Android works with a different dp unit than an HTLM or CSS we use px or %. Each screen has its specific density. Remember to save the images correctly and you won't have any big problems.

Hope this helps

Scroll to Top