Hii friends i had a problem related to font sizes .
I had create an android application now the problem is i had set the font sizes for large hdpi screen but these font sizes are not set on device s3 mini which is a large hdpi device .
On the other hand on emulator it reflects the changes madein Font Sizes.I don't understand what is the problem.I am posting two images .please help if any one know about the problem.
Specify the font size in sp (If you had given a font size as 10px or dp then replace it as 10sp).
I have an S3 mini, and it is not a large-hdpi device. It is normal-hdpi. That probably explains why your changes have no effect.
Related
I have values-xxhdpi folder having dimens.xml file, i set the font size 34sp in nexus 5. When I put this on the samsung s5 the font looks very small. Is there any possible way of having the font size look the same (size wise) on both devices?
android:textSize="#dimen/font_size_34sp"
I have find screen size difference
Nexus5 4.9"
S5 5.1"
Provide me generic solution, if possible I want to be able to do this in XML.
You could have a method at run time (onCreate) to get the screen dimensions then based on that re-size the font dynamically.
As different phones have the same DPI but different screen dimensions.
Please also view this
I'm using custom fonts for all components in my application. All font sizes are defined in dimens.xml file in sp format.
However fonts are bigger (wider?) on HTC ONE and smaller on Galaxy S4 which messes up my layouts. Any idea how can I correct this?
Sorry, my fault.
I just realized, that sp calculates font size based on user preferences.
can I change layout dpi that use my application on device?
(on developed application that works fine but on small screen size devices everything looks big )
You'll want to supply resources for all the screen size buckets:
/drawable/ (default images)
/drawable-ldpi/ (small dpi screens)
/drawable-mdpi/ (medium dpi screens)
/drawable-hldpi/ (large dpi screens)
/drawable-xhdpi/ (xtra large dpi screens)
See here for help: http://developer.android.com/guide/practices/screens_support.html
and here for a list of devices using which DPI bucket: http://blog.blundell-apps.com/list-of-android-devices-with-pixel-density-buckets/
small screen size devices everything looks big .
Read this Supporting Different Device
Its an layout issue ,Try to use relative layout and linear layout for placing the objects in xml.And for images use .png extension and use nine patch images ,so that it fits in all screen,this will support most of the screens
You need make images for all DPI screen so that it is supported by all types of devices.
Android automatically sets these images for your application according to your device DPI.
Please be sure of all of your resources and see link. It will help you more.
I am stuck in a situation.
I created an application for Samsung Galaxy Tab 7". The same application when i run on the HTC Flyer it shows very small fonts.
I tried following :
I thought may be the screen of HTC Flyer is xhdmi so i crated folders accordingly
res -> values-large-xhdmi -> styles.xml -> <item textsize>20</item>
res -> values-large-> styles.xml -> <item textsize>16</item>
this is not working.. :(
any help will be highly appreciable in this regard.
Thanks.
Check out this recent blog post on sizes: http://android-developers.blogspot.com/2011/07/new-tools-for-managing-screen-sizes.html
A typical 7” tablet has a 1024x600 mdpi screen. This also counts as a
large screen.
The original Samsung Galaxy Tab is an interesting case. Physically it
is a 1024x600 7” screen and thus classified as “large”. However the
device configures its screen as hdpi, which means after applying the
appropriate ⅔ scaling factor the actual space on the screen is 682dp x
400dp. This actually moves it out of the “large” bucket and into a
“normal” screen size. The Tab actually reports that it is “large”;
this was a mistake in the framework’s computation of the size for that
device that we made. Today no devices should ship like this.
So you need to think of the Galaxy as a large sized screen but with hdpi.
THe HTC Flyer will be large sized screen but with mdpi.
When specifying sizes you need to stick with dp, as this normalizes all sizes to scale appropriately for the different density screens. Use a dimension to specify in a xml value resource.
As milind hinted (i think), it is probably better to use the same style for these two screen sizes and specify a dimen resource. This resource can then be customized for the different displays.
The bottom line, however, is that you are using text size differences based on the screen size. The text size should be indicated in dp, so it will scale accordingly to any screen density. Really, the only resources that should be based on screen size are layouts.
If you are plan to make Multiple resolution Supporting android application just you have care about image and xml no other needs that you have same images with three different size putting in different folders like drawable-hdpi, drawable-ldpi, drawable-mdpi. you can make style.xml common for all.
Thanks
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.