1

I am using the visual editor in Android Studio. In there, the text is really big, like how I want it to be. But when I build it on a physical device it is default size.

Thanks in advance!

  • 1
    It is because Screen Density and Screen Sizes are different on some devices. On the high resolution phones, the text will appear smaller since the density of the screen is high. To solve that issue, you will need to create a separate layouts for each screen density and size – Yunus Kulyyev Sep 29 '18 at 23:28
  • 1
    In android Font size should be in DP, And for different resolution value of that DP is different for that you have to calculate for all type device. Like XDP,XXDP,HDP. If you would like to avoid calculation you can use this library https://github.com/intuit/sdp If it's helpful than please revert back – Jay Patel Sep 30 '18 at 03:59
  • I'm using the Google CodeLabs tutorial: https://codelabs.developers.google.com/codelabs/build-your-first-android-app/#4 How come it says SP? – AwesomeMaster Sep 30 '18 at 14:48
  • DP doesn't work either. Still the same size. Is there anything I am missing? – AwesomeMaster Sep 30 '18 at 14:55

2 Answers2

1

simply create many layout that support pixels make all your layout handle your show way

read this to understand the idea

https://developer.android.com/training/multiscreen/screensizes

and do this in your code then check the devices

https://stackoverflow.com/a/8256573/6998825

Hassan Badawi
  • 302
  • 1
  • 10
0

there's also something else you may have not noticed yet

in android studio Preview Layout you can choose your the preview device as your actual device or same as it.

enter image description here

this way the preview design will be same as your device. but for other devices you should have above answers in mind.

Mohamad Rostami
  • 420
  • 3
  • 17