Text Size Ratio Between Mobile and Tablet Android - android

What is recommended text size ratio between mobile and tablet device?
I am currently working on the application for supporting different screen sizes .I am facing issue with text sizes ,after some reasearch , I found that creating different values folder will solve my problem .
But I didn't know multiplication ratio which I can use to best decide on text size for a Tablet and 7" Device Screen .
if have a text with size of 20SP in normal phone screen
then what is the corresponding text size for tablet
How can I calculate the corresponding value for tablet any formula ?

Related

Text size doesn't keep aspect ratio in android studio

phone image
tablet image
I am using this line of code in android studio
btn_play_game1.setTextSize(16 * getResources().getDisplayMetrics().density );
to set the text size to a button (that has an image on it). The text is "Clear The Way" but on phone emulator looks very big and smaller on tablet.
Why the text is not as adapt to the screen size and keep the aspect ratio?
Thank you!
I think instead of multiplying your font with display density you should use the resource declared in dimens.xml file like getResources().getDimension(R.dimen.text_size_medium) this way it would not only take care of the device density but also take into account the font size set by the device user.

Android Screen Sizes for different devices

I am new to android development and now i have started developing wallpaper apps.I saw the android developer page which tells the ratio 3:4:6 or something which i don't understand. Everything is working but the image which i set go off the screen sometimes it gets cropped around the corners and image does not look good. i use the screen size 600*480 in hdpi. Any suggestion about the different size images i should use may be for ldpi,mdpi,hdpi, xhdpi.I want my wallpaper look good in home screens of both tablets and for large size screen mobiles.
Thank You.
3:4:6:8 , so if you have 600*480 in hdpi then it should go like this
3k:300*240
4k:400*320
6k:600*480
8k:800*640
but since there are multiple device with same dp but different screen size, you can never quitly fit for every device

Android: device independent pixel

I know using dip is good for compatibility to different screen devices. But I would like to ask i a tablet of 600*800 as an example with a text field of 600 dip fit to the screen. Does it still fit on on a 400*320 screen as well.

Different Text Size under same screen resolution but different dpi in two Android machines

I have two Android machines - Samsung Galaxy Tab and HTC Flyer. They both have 1024x600 screen. However Tab has 240dpi screen while Flyer has 160dpi according to the log from Context.getResources().getDisplayMetrics() method.
My problem is that, I have a TextView defined, and according to those Android document, using unit of dp should give same physical size under different screen density(dpi). But what I observed is that, the text size appeared in Flyer is obviously smaller than that in Tab, no luck in using sp too. I want them to be in same size. Any clue in solving this problem in general?
Thanks in advance.
Well, the reported values are clearly a lie. I suppose the Galaxy Tab is the 7in model. This means that, based on the reported values, it has about 4.2in display height (1024 / 240 = 4.2in) and about 2.5in width. This means that the screen size would be 4.2x2.5 in - and in this case the diagonal would be about 4.9in. Is it correct - no it isn't, it has 7in display. Measure the sides of the screen and you would get the correct density. So, even when scaled by Android the result will be wrong because of the false density measurement.
Anyway, the answer of the question is:
No, no way to draw same-sized fonts, images and whatever. You need to get used to false metrics from the manufacturer. A false density reading reflects on all other scaling. Thus even mm/in would not help.
And one advise - don't try to match sizes between different products, unless absolutely necessary. If you succeed, then the text on the Galaxy Tab, for example, will look disproportional in regards to the other text on the device and will make your app look out-of-place. Stick to the Android textAppearanceSmall/Large, etc.
Please try the following units:
mm
Millimeters - based on the physical size of the screen.
in
Inches - based on the physical size of the screen.
http://developer.android.com/guide/topics/resources/more-resources.html

Text scaling properly on different mdpi devices with different resolutions

I've started work to get my games to scale nicely on the higher-res displays like the Xoom and Galaxy Tab 10.1.
I've made use of the ldpi/mdpi/hdpi/xhdpi folder naming convention for my resources which works nicely for layouts and graphics, but not so much for text size scaling. The problem is that an Evo and a Galaxy Tab 10.1 (for example) are both mdpi devices and will map to the same layout file. Yet, I need to scale the text size for some of my TextViews differently for these two devices. For the record, I'm using dp for the text size units.
Any ideas would be much appreciated.
Mike
Consider using sp for text sizes.
Apply different layouts based on screen size (not screen density), as described at http://developer.android.com/guide/practices/screens_support.html.

Categories

Resources