Android different margin_Top dp in every size of screen - android

I actually have fixed margin_Top, which is 50dp. But when I tested with different size of screens, the imageview will not be in the same position as each other. Therefore, I searched something about how to adjust the dimen.xml in values. But I have no idea how to edit, create new dimen.xml, and calculate the size in different screens.
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="#dimen/activity_vertical_margin"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin"
android:layout_centerInParent="true"
tools:context="com.example.mygames.MainActivity$PlaceholderFragment">
<ProgressBar
android:id="#+id/circularProgressbar"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="350dp"
android:layout_height="750dp"
android:indeterminate="false"
android:max="100"
android:progress="50"
android:progressDrawable="#drawable/circular"
android:secondaryProgress="100"
android:layout_marginBottom="110dp"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
<ImageView
android:layout_width="150dp"
android:layout_height="150dp"
android:background="#drawable/whitecircle"
android:id="#+id/imageView3"
android:layout_alignTop="#+id/tv"
android:layout_centerHorizontal="true"
android:layout_marginTop="50dp" />
<TextView
android:id="#+id/tv"
android:layout_width="250dp"
android:layout_height="250dp"
android:gravity="center"
android:text="25%"
android:textColor="#ffffff"
android:textSize="35sp"
android:textStyle="bold"
android:layout_marginBottom="57dp"
android:layout_alignBottom="#+id/circularProgressbar"
android:layout_centerHorizontal="true" />
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="16dp"
android:textSize="20sp"
android:text="Progress" />
</RelativeLayout>
My dimen.xml:
<resources>
<!-- Default screen margins, per the Android Design guidelines. -->
<dimen name="activity_horizontal_margin">16dp</dimen>
<dimen name="activity_vertical_margin">16dp</dimen>
<dimen name="fab_margin">16dp</dimen>
<dimen name="appbar_padding_top">8dp</dimen>
</resources>

This is done in a different way.
Like you can put a layout for landscape mode in a folder layout-land you can put values files (like dimens.xml) in different folders too.
Example is the values-w820p folder which is created in a default project.
the -wxxxx is the screen dimension (for tablets and the like).
So you just need copies of your dimens.xml in different values folders, each containing the values for the screen size.
I am not native english, I hope you understand what I mean.
Android will automatically pick the file which fits the currently running device best.
Read through the resource features here: https://developer.android.com/guide/topics/resources/providing-resources.html
Here is a simple example:
in your values folder is dimens.xml which holds
<dimen name="examplewidth">50dp</dimen>
now create a folder values-mdpi and just copy the dimens.xml file into that folder.
in that copy you change the value from 50dp to... say 20dp.
Then examplewidth will be 50dp on all devices except on low-res screens (mdpi) where it will resolve to 20dp. Automatically you do not need to write a single line of code.

Related

Which qualifiers should I use for supporting my layouts for different phones screens?

I have some problems with supporting my layouts for different phone/tablet screensizes. My layouts dosn't fit or scale on all screens probably. Some screen sizes give too much space and other dosn't have room for all views.
I have tried to generate different layouts with different qualifiers like: densities, dimensions and sizes in PX and with large/small/x-large qualifiers.
But I can't really figure out what qualiferes I should use to completely fit all screens.
This is a description of how my layouts behave with different screens (tested with genymotion emulator)
480px x 800px 240dpi (S3 Mini): Views dosn't fit in heights.
480px x 800px 120dpi: (Emulator): Views dosn't fit in heights
480px x 800px 320dpi: Too much free space around the views.
600px x 1024px 240dpi: Perfect fit!
600px x 1024px 420dpi: There is almost no space to show anything. maybe 2-3 views at max
1440px x 2560px 560dpi: a little bit of free space
1440px x 2560px 640DPI: Perfect fit!
1440px x 2560px 320DPI: Too much free space around the views
Here is screenshots examples of how the layout Stats scale with different screens:
Samsung S3 MINI: 480px x 800px 240dpi: https://www.dropbox.com/s/kvxggql80ivcmlp/galaxys3mini.png?dl=0
Samsung Galaxy S7: 1440px x 2560px 640DPI: https://www.dropbox.com/s/ivjd6a0zgc81oqy/galaxys7.png?dl=0
Nexus 9 API 23 2048x1536 xhdpi:https://www.dropbox.com/s/r70h4da1xcf2lhi/nexus9.PNG?dl=0
What qualifiers should I use?'
The layouts xml:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/arion_darkblue">
<TextView
android:id="#+id/stats_title"
style="#style/fragment_titles_style"
android:layout_alignParentTop="true"
android:text="Stats" />
<RelativeLayout
android:id="#+id/statsgroup1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#id/stats_title"
android:layout_centerHorizontal="true"
android:layout_marginTop="25dp">
<ImageView
android:id="#+id/stats_distance_img"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="20dp"
android:background="#drawable/ic_stats_distance" />
<TextView
android:id="#+id/stats_distance_txt"
style="#style/fragments_textstyles"
android:layout_below="#id/stats_distance_img"
android:text="0,0 Km" />
<ImageView
android:id="#+id/stats_jump_img"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_marginLeft="35dp"
android:layout_toRightOf="#id/stats_distance_txt"
android:background="#drawable/ic_stats_jump" />
<TextView
android:id="#+id/stats_jump_txt"
style="#style/fragments_textstyles"
android:layout_below="#id/stats_distance_img"
android:layout_marginLeft="35dp"
android:layout_toRightOf="#id/stats_distance_txt"
android:text="00" />
<ImageView
android:id="#+id/stats_transition_img"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="65dp"
android:layout_toRightOf="#id/stats_jump_txt"
android:background="#drawable/ic_stats_transition" />
<TextView
android:id="#+id/stats_transition_txt"
style="#style/fragments_textstyles"
android:layout_below="#id/stats_distance_img"
android:layout_marginLeft="80dp"
android:layout_toRightOf="#id/stats_jump_txt"
android:text="00" />
<ImageView
android:id="#+id/stats_intensity_img"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="40dp"
android:layout_toRightOf="#id/stats_transition_img"
android:background="#drawable/ic_stats_intensity" />
<TextView
android:id="#+id/stats_intensity_txt"
style="#style/fragments_textstyles"
android:layout_below="#id/stats_distance_img"
android:layout_marginLeft="55dp"
android:layout_toRightOf="#id/stats_transition_txt"
android:text="0000" />
</RelativeLayout>
<RelativeLayout
android:id="#+id/stats_symmetric_group"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#id/statsgroup1"
android:layout_marginTop="50dp"
android:paddingLeft="30dp"
android:paddingRight="30dp">
<TextView
android:id="#+id/stats_sym_txt1"
style="#style/fragments_textstyles"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginRight="10dp"
android:text="50%" />
<ImageView
android:id="#+id/stats_symmertic_img"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toRightOf="#id/stats_sym_txt1"
android:background="#drawable/ic_stats_symmetric" />
<TextView
style="#style/fragments_textstyles"
android:layout_centerVertical="true"
android:layout_marginLeft="10dp"
android:layout_toRightOf="#id/stats_symmertic_img"
android:text="50%" />
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true">
<TextView
android:id="#+id/stats_rotation_txt1"
style="#style/fragments_textstyles"
android:layout_alignParentLeft="true"
android:layout_marginRight="10dp"
android:text="50%" />
<ImageView
android:id="#+id/stats_rotation_img"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="#id/stats_rotation_txt1"
android:background="#drawable/ic_stats_rotation" />
<TextView
android:id="#+id/stats_rotation_txt2"
style="#style/fragments_textstyles"
android:layout_marginLeft="10dp"
android:layout_toRightOf="#id/stats_rotation_img"
android:text="50%" />
</RelativeLayout>
</RelativeLayout>
Have you heard about using several dimens.xml file?
Having different dimens but one layout
That way you could have one layout, but could define sizes of elements from different dimens.xml-s which are describing dp sizes separately for each size you'd like to support.
Example from the offical android page:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="textview_height">25dp</dimen>
<dimen name="textview_width">150dp</dimen>
<dimen name="ball_radius">30dp</dimen>
<dimen name="font_size">16sp</dimen>
</resources>
Then you can use these values from the layout:
<TextView
android:layout_height="#dimen/textview_height"
android:layout_width="#dimen/textview_width"
android:textSize="#dimen/font_size"/>
If you have several dimens.xml but only one layout.xml for a page, it's easier to change them consistently.
Design layout for tablet sizes
Also, consider checking the smallestWidth resource using for tablet sizes, you can handle larger screens easily width this, adding dimens.xml and/or layout to folders like layout-sw600dp/ and values-sw600dp/.
More info here

How to align an image-view for all android screens

I want to align an image view which is displayed same for all android screens expect for Android tab screen. Different alignment of imageview is noticed for imageview when app runs on emulator or live device. how do i align them properly??
Here is my activity.xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="#dimen/activity_vertical_margin"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin"
tools:context=".MainActivity"
android:background="#fff" >
<ImageView
android:id="#+id/forts"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_marginRight="150dp"
android:src="#drawable/forts" />
<ImageView
android:id="#+id/portal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/forts"
android:layout_below="#+id/forts"
android:src="#drawable/portal" />
<ImageView
android:id="#+id/emergency"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/forts"
android:layout_toRightOf="#+id/portal"
android:src="#drawable/emergency" />
<ImageView
android:id="#+id/aboutus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/portal"
android:layout_toLeftOf="#+id/emergency"
android:src="#drawable/aboutus" />
<ImageView
android:id="#+id/maps"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/emergency"
android:layout_alignLeft="#+id/emergency"
android:src="#drawable/maps" />
<ImageView
android:id="#+id/mailus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/emergency"
android:layout_alignTop="#+id/aboutus"
android:src="#drawable/mailus" />
</RelativeLayout>
You can have set variable dimen in different values folder as
1:values
-dimens.xml
<dimen name="image_email_width">45dp</dimen>
<dimen name="image_email_height">35dp</dimen>
2:values-xlarge
-dimens.xml
<dimen name="image_email_width">90dp</dimen>
<dimen name="image_email_height">70dp</dimen>
Then set your Imageview as
<ImageView
android:id="#+id/portal"
android:layout_width="#dimens/image_email_width"
android:layout_height="#dimens/image_email_height"
android:layout_alignLeft="#+id/forts"
android:layout_below="#+id/forts"
android:src="#drawable/portal" />
For different screen size and different densities image will differ.
For fitting the image into imageview usee,
android:scaleType="fitXY"
If you want your imageview similar to all devices, you need to create different layout folders for different screen sizes and different images like ldpi,hdpi,mdpi for different densities.
Use different types of images i.e. ldpi, mdpi, hdpi, xhdpi, xxhdpi.

Make buttonsize bigger for tablet? Android, Xml

I have a android view with 2 buttons centered. I want to change the button sizes to be bigger when I run the app on a tablet because they look ridiculous small there since it is the same size as for the phones.
How can I do this?
This is my code:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#e9e9e9"
android:orientation="vertical"
android:paddingBottom="#dimen/activity_vertical_margin"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin" >
<ImageView android:id="#+id/imageView1"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_centerInParent="true"
android_layout_gravity= "center"
android:layout_marginLeft="30dp"
android:layout_marginRight="30dp"
android:src="#drawable/icon_bakgrund_android">
</ImageView>
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TableLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/TableLayout01"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_centerInParent="true"
>
<TableRow android:id="#+id/TableRow01"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<Button
android:id="#+id/button1"
android:layout_width="260dp"
android:layout_height="50dp"
android:background="#drawable/nybutton"
android:layout_below="#+id/button2"
android:text="#string/las_sollefteabladet"
android:textColor="#ffffff"
android:layout_centerHorizontal="true"/>
</TableRow>
<TableRow android:id="#+id/TableRow02" android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:scaleType="centerCrop">
<Button
android:id="#+id/button2"
android:layout_width="260dp"
android:layout_height="50dp"
android:layout_marginTop="10dp"
android:background="#drawable/nybutton"
android:layout_centerInParent="true"
android:text="#string/annonsorer"
android:textColor="#ffffff"
/>
</TableRow>
</TableLayout>
</RelativeLayout>
</RelativeLayout>
Here you go
insert in the button code
android:layout_weight="some integer value according to your need"
Simply make a separate layout file and place it in the folder
'Layout-xlarge'
or
'Layout-large'
You can do either of the following
make separate layout for large screen
use layout:weight for the buttons. Hence the button size will be set depending on the screensize.
You can create different dimen.xml for different screen densities, so you can have only one layout to adjust to multiple screens.
EDIT:
You have to create several folders for diferent densities (values-mdpi, values-hdpi, etc) and in each you create a dimens.xml . Then you add dimension items like this:
<dimen name="title_small_font_size">14sp</dimen>
<dimen name="header_title_font_size">32sp</dimen>
and so, in each file, adjusting the number as you need. And then, in your button you set the button attributes for example:
android:textSize="#dimen/grid_title_text_size"
Hope it helps.
As far as my knowledge goes, giving static width and height for the button will not be good option here. All you have to do is to create a background image for the button for all type of mobile and tablet size and keep these images in appropriate drawable folders, and try to give the textAppearance for the text of the button like this:
android:textAppearance="?android:attr/textAppearanceLarge"
I copy and past my layout-folder, renamed it to layout-large (with a small l) and took in all my xml views and changed them and it works fine.
Thanks!

Support text in multiple screen size

I have researched on many relevant topics but the topics mainly revolve around images. I had understand this: http://developer.android.com/guide/practices/screens_support.html but I don't really get the idea of dynamic resizing for the fonts.
For images there's no problem, I used the ldpi, mdpi, hdpi and xhdpi. However for the fonts, I do not know how to resize them. Anyone?
My codes is as followed:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/layoutHeader"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#drawable/headerimage"
android:orientation="horizontal">
<TextView
android:id="#+id/headerTitle"
android:layout_width ="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:textColor="#FFF"
android:textSize="28dp"
android:textStyle="bold"
android:text="Some Random Banner Title"
style="#style/headerTextStyle"
/>
<ImageButton
android:id="#+id/btnPlus"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_marginRight="5dp"
android:layout_marginTop="6dp"
android:background="#0000"
android:scaleType="centerCrop"
android:src="#drawable/plus" />
<ImageButton
android:id="#+id/btnInfo"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginTop="6dp"
android:background="#0000"
android:scaleType="centerCrop"
android:src="#drawable/info" />
<ImageButton
android:id="#+id/btnGuide"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_centerVertical="true"
android:layout_toLeftOf="#+id/btnPlus"
android:background="#0000"
android:scaleType="centerCrop"
android:src="#drawable/guide" />
</RelativeLayout>
I would put the text sizes in a style resource, then use alternate style resource files for screen sizes..
so you will have res/values-large/style.xml, res/values-small/style.xml, etc. Each of those styles will contain the item for the text size with different dp values. Remember, hdpi, mdpi, ldpi etc have to do with pixel density, not screen size.
So for instance, if in res/values/style.xml you have:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="headerTextStyle" >
<item name="android:textSize">28dp</item>
...
</style>
</resources>
in another resource file, suppose for large screen (res/values-large/style.xml) :
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="headerTextStyle" >
<item name="android:textSize">46dp</item>
...
</style>
</resources>
Then of course apply this style to the element, and the system will pick the correct one based on the device's screen size.. You can provide multiple styles in the same file, one for header text, one for regular text - whatever distinct types of text you need, similar to CSS.
Alternatively, you could duplicate your layout file in similarly qualified resource directories, like res/layout-large/layout.xml, res/layout-small/layout.xml and have different text sizes in each, but this will be duplicating more xml unnecessarily.

Same layout looks different on a Samsung Galaxy Tab

I'm developing an Android 2.2.2 application which will support multiple screens sizes and all screens will be portrait. I won't support landscape.
I have test the following layout on an HTC Desire and on a Samsung Galaxy Tab 7.7.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/mainLayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#drawable/no_conectado"
android:orientation="vertical" >
<TextView
android:id="#+id/labelSelGateName"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:layout_marginTop="80dp" />
<TextView
android:id="#+id/labelSelOpened"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal" />
<ProgressBar
android:id="#+id/indicatorActivityView"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginTop="22dp"
android:layout_gravity="center_horizontal" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="110dp"
android:layout_marginTop="60dp"
android:orientation="horizontal" >
<ImageButton
android:id="#+id/btnMyGates"
android:layout_width="50dp"
android:layout_height="110dp"
android:layout_marginLeft="20dp"
android:layout_weight=".33"
android:background="#null"
android:contentDescription="#string/layout_empty"
android:onClick="onGateClick" />
<LinearLayout
android:layout_width="90dp"
android:layout_height="110dp"
android:layout_weight=".33"
android:orientation="vertical" >
<ImageButton
android:id="#+id/btnOpen"
android:layout_width="90dp"
android:layout_height="55dp"
android:layout_gravity="center_horizontal"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:background="#null"
android:contentDescription="#string/layout_empty"
android:onClick="onOpenDoorClick" />
<ImageButton
android:id="#+id/btnClose"
android:layout_width="90dp"
android:layout_height="50dp"
android:layout_gravity="center_horizontal"
android:layout_marginTop="10dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:background="#null"
android:contentDescription="#string/layout_empty"
android:onClick="onCloseDoorClick" />
</LinearLayout>
<ImageButton
android:id="#+id/btnOptions"
android:layout_width="50dp"
android:layout_height="110dp"
android:layout_marginRight="20dp"
android:layout_weight=".33"
android:background="#null"
android:contentDescription="#string/layout_empty"
android:onClick="onOptionClick" />
</LinearLayout>
<ImageButton
android:id="#+id/btnFaqs"
android:layout_width="110dp"
android:layout_height="60dp"
android:layout_gravity="center_horizontal"
android:layout_marginTop="10dp"
android:background="#null"
android:contentDescription="#string/layout_empty"
android:onClick="onFAQClick" />
<ImageButton
android:id="#+id/btnInfo"
android:layout_width="110dp"
android:layout_height="60dp"
android:layout_gravity="right"
android:layout_marginTop="20dp"
android:background="#null"
android:contentDescription="#string/layout_empty"
android:onClick="onInfoClick" />
</LinearLayout>
I have images for ldpi, mdpi, hdpi and x-hdpi.
Background image looks great, but all widgets (TextView, ProgressBar, ImageButton, etc) aren't in the right position when I test it on Samsung Galaxy Tab.
I have designed this layout on Eclipse using 'Nexus One` as a model.
Here people are recommend me that use only one layout for every screen size and densitiy, but it doesn't work. I'm using dp units and fill_parent, etc. but it is different on Galaxy Tab.
Do I need a layout for x-large screen sizes?
Indeed, the advice you received was good: it's possible to have only one layout file, but as it was already suggested in comments, it's not good to hardcode dimensions, even if you use dp or dip, specially when you are targeting all the screen sizes and densities available.
Instead, you should replace those values with links to dimensions values.
For example, instead of android:layout_marginLeft="10dp", you'll have something like
android:layout_marginLeft="#dimen/textview_margin_left"
where textview_margin_left is defined in the dimens.xml, having different values in different folders;
probably in folder values: <dimen name="textview_margin_left">10dp</dimen>,
in folder values-large: <dimen name="textview_margin_left">20dp</dimen>,
while in values-xlarge: <dimen name="textview_margin_left">30dp</dimen>
But this is just an example, you have to test on all dimensions and resolutions and find the best values for your layout. In Eclipse, in Graphical Layout mode, you can easily get an idea about how your layout looks on various devices, just by clicking on Nexus One, and choosing another model from the list, and the layout will automatically update.
Also, you can move in dimens.xml all the text sizes, and that will be very useful for x-large devices.
Using only one RelativeLayout instead many imbricated LinearLayouts might also be a good idea, and using relative positioning for your objects, instead some of the hardcoded values.
The Problem is following you use in your layout, static values (100dp, 60dp). Now the problem is on a higher resolution this dp isn't the same.
That means you should create a layout for x-large screens. Also I wouldn't use those static values. Than your application will behave good on many diffrent screensizes!
Have a great Day
safari

Categories

Resources