i am using a galaxy tab 1, 7inch hdpi and a galaxy tab plus, 7 inch hdpi but more resolution, and in my application, the text can be read fine in galaxy tab but in galaxy tab plus there are too much small. Im using sp in font size and layout-large. Any idea? Thanks
Select 'Display'. Select the 'Change display settings' link towards the top of the window on the left-hand side. In the 'Resolution' section, select the pull-down bar, and a slider bar should appear. Move the slider bar down to make the text larger, or move it up to make the text smaller.
Screen size is measured in inches, e.g. 5”, 10”, 13”, 17”, etc. Screen size and screen resolution aren't directly related. For instance, you can have a 10.6” tablet with a resolution of 1920 x 1080 and a 24” desktop monitor with the same resolution.
This should be some help for you if you want to set size programmatically. Text will show in the same size on each device
TextView text = new TextView(this);
text.setText("text");
text.setTextSize(16 * getResources().getDisplayMetrics().density);
By hardware specifications Galaxy Tab 1 is MDPI device, but because it uses Android 2.x Samsung set it programmatically to use HDPI resources. So I can advice you to make following:
dimens.xml
in values
directory.<dimen name="font_size">30sp</dimen>
. This is default font size.dimens.xml
in values-large
directory.<dimen name="font_size">20sp</dimen>
. This is font size for galaxy tab 1.dimens.xml
in values-sw600dp
directory.<dimen name="font_size">30sp</dimen>
. This is font size for other tablets with Android 3.x and newer.android:textSize="@dimens/font_size"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With