While developing an application this is what i did :
1.Kept 320*480 as my base resolution and 160dpi as my base density.
2.Kept all the images in drawable-mdpi folder
3.made use of dp while specifying the width and height of the images in xml layouts.

what i found was as its mentioned on the developer's site if we use dp then it does scaling automatically scales up and scales down according to the screen.But i didn't got the desired result and the images didnt scaled properly for the smaller device.

So what i did was
1.created the layouts in xml files
2. the set the width and height of the images at runtime in percent of the screen width and height
And by doing this i got the desired result.The images scaled properly on all the devices ranging for small 240*320 to tab 600*1024.

So my question is that as mentioned in the developer site should i use dp for specifying the width and height or should i do it programmatically.And if no what is the concept of dp and where can i use it ?

I can't afford to save all the images in the respective folder as i have many images and plus its not the solution i am looking for.What i want is that i should have one or two layouts for and images should be saved at most in two of the folder and my layout and images should scale on every device.
–
sanketttJun 23 '12 at 9:23

Then you can predict the size of the device dynamically and set the layout(placement and scaling of images) accordingly. I have edited the answer for that.
–
Yogesh SomaniJun 23 '12 at 9:40