I am new to programming for Androids. I am seeking for any information about programming for Androids. Now I am wondering how to change -for example- buttons size considering of what is screen size.
As an example I have:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_gravity="center_vertical"
android:baselineAligned="false"
android:layout_marginLeft="40px"
android:layout_marginRight="40px"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
</LinearLayout>
And now I need this layout for a phone:
android:layout_marginLeft="40px"
android:layout_marginRight="40px"
but if there would be a tablet then I need
android:layout_marginLeft="200px"
android:layout_marginRight="200px"
How could I achieve this?
Also if you have bookmarked good tutorials on how to handle orientation please share.
Thanks.
I would suggest you to read up on “Supporting multiple screens” guide from android developers site and especially the section on “Declaring Tablet Layouts”.