Tell me how to do it right ... I have 2 real devices for the test, one Samsung c5, and the second one is some kind of Chinese ... When I work with text, it looks more on the other screen less than the other.

I thought that the different density of screens and created folders ldpi, mdpi, hdpi, xhdpi, xxhdpi, xxxhdpi and began to test which folder for which device will be determined by the system. Of course in each invested such dimen resources

 <resources> <dimen name="activity_header_button_size">14sp</dimen> <dimen name="activity_text_size">8sp</dimen> </resources> 

First I connected the Chinese and resized it in the folder for the smallest density ldpi on

 <resources> <dimen name="activity_header_button_size">20sp</dimen> <dimen name="activity_text_size">14sp</dimen> </resources> 

Nothing has changed ... I returned everything to its original state and continued changing it in each folder in a growing way and determined by scientific method that this Chinese device responds when I change the size in the folder

 xxhdpi 

And that's all for her.

I connected the Samsung and started doing the same thing and my surprise was when I determined that he, too, only responds to this xxhdpi folder

But why, then, if the system determines the densities of their screens as identical, the dimensions do not look the same on them ??

When I install xxhdpi in this folder, xxhdpi are the sizes

 <resources> <dimen name="activity_header_button_size">20sp</dimen> <dimen name="activity_text_size">14sp</dimen> </resources> 

Then on the Chinese I get this picture

enter image description here

And on samsung just such

enter image description here

It can be seen that you need to install smaller sizes on the Chinese device in order to get the expected result, but how can this be done if the system determines the same resource folder for them?

  • What are the resolutions and physical screen sizes of both devices? It may be worth finding what is different in Chinese, and making a unique folder (sw <N> dp, large, etc.): developer.android.com/intl/ru/guide/topics/resources/… - kit
  • 2
    Turn off the increased font size for the Chinese in the settings of its screen. Or use dp instead of sp if you don’t want to support larger font sizes. - xkor
  • @xkor Yes indeed, I didn’t even know that there was such an opportunity ... But tell me, if I understood correctly, to avoid such a situation in the future when the increase is at the level of the device, can I set the dimensions in dp and they will not increase? - Aleksey Timoshchenko
  • Yes, it is precisely this that dp differs from sp and - xkor

0