There is main issue in android to design your application in a way to application should look proper in all devices whether it will small size device or it will tablet, So Today I am going to Explain How to design your application For different size of devices.
Step - 1:
First Create New Sample application,
For Create New Application in Eclipse go to
File-> New-> Android Application Project
Now Press Next...Finish.
Step - 2:
Set "res" Folder,
Create new 4 folders in "Package Explorer -> YourApp -> res" folder,with name
- values-small
- values-normal,
- values-large
- values-xlarge
(Note : if you cant get find Package Explorer then go to in Menu bar
"Window -> Show View -> Package Explorer")
Now Create XML file in all this 4 new folders with same name "dimens.xm".
Step - 3 :
Set TextSize of Textview:
Open Your main design xml page from Layout folder.and take one textview
and call text size from dimens.xml file as give in below.
Yes,It will give an error when we set "textsize" in textview because we trying to fetch value of textsize from dimen.xml but we are still not define value in dimens.xml,So let we define it in all dimens files.
Step - 4:
define TextSize in all dimens.xml:
now set values of textsize in dimens file,
For "values-small -> dimens.xml" use below code,
<dimen name="textsize">16dp</dimen>
For "values-normal -> dimens.xml" use below code,
<dimen name="textsize">20dp</dimen>
For "values-large -> dimens.xml" use below code,
<dimen name="textsize">35dp</dimen>
For "values-xlarge -> dimens.xml" use below code,
<dimen name="textsize">55dp</dimen>
Thats it!!!!
Now when you can check your output for all devices it will look appropriately for all devices .
By this way devices will fetch textsize from dimens.xml.
Device Size
- For devices of size < 2.7" fatch vaues from values-small
- For devices of size 3.2" to 4.7" fatch vaues from values-normal folder
- For devices of size 5.1" to 7.0" fatch vaues from values-large folder
- For 10" tablet fatch vaues from values-xlarge folder


