I wonder how to make the application look the same on different devices. I have read Multiple Screen Support many times, but I still can't figure out how to live.
Here is an example layout:
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" > <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Hello World, MyActivity" android:textSize="30sp" /> </LinearLayout>
There is a Galaxy S II (480x800) and a Sensation XE (540x960). They are both hdpi , the size of the physical screen is almost the same. I expected to see the same thing on both devices, but actually the text is 540x960 less than 480x800:
(480x800 on the left, 540x960 on the right).
I tried to specify the text size as a measurement resource and make a separate values-w540dp , but that did not affect.
How do you guys make your application look the same on different hdpi devices?
darja source share