Actually I need some suggestion like Designing screens for android mobile as well as tablet. As of now im creating two different folder for xml one is for mobile and another one is for tablet. Im placing images in 4 different images with 4 different resolution like (160 dpi, 240 dpi, etc). so am i going in right way or i need to change the way of designing. Thanks.
2 Answers
When designing for different devices it is important to test whether there is a necessity to create different layout files for the different devices. If you find that you do want that then there is plenty documentation online about it. Read these first:
Designing for different screen sizes
More android screen size documentation
Each of these links explain the new methodology of designing for multiple screen sizes.

- 1,453
- 2
- 14
- 21
A few tips on top of the already answered question that I gained by experience:
- Use @dimen everywhere you have to specify a width/height but in general, avoid specifying them if you can. This way, you can override the dimension based on the available DPI and don't have to replicate your layouts.
- Use LinearLayout wherever you can and use weights to determine how things should be drawn. Other layouts like relative layout are fine as long as they're used for positioning (isLeftOf for instance) as opposed to making a certain space available.
- Use fragments wherever you can. It's much easier to work with self contained fragments. In general, avoid having any UI logic in your activities and let the fragments handle them.
- Use the Android Asset Studio (http://romannurik.github.io/AndroidAssetStudio/icons-actionbar.html#source.space.trim=1&source.space.pad=0&name=ic_action_example&theme=light&color=33b5e5%2C60) which will take care of resizing your images for you. It's been very valuable to me. Have a look at these other projects too. They can help you in many aspects when designing your UI: http://romannurik.github.io/AndroidAssetStudio/
Even when you do all this, you may come across a scenario where you really do need to write a different layout for tablet and phone. If this is the case, as long as you've created everything in self contained fragments, it's much easier to switch fragments or even use the same fragment code with different layouts (as long as they contain the same UI elements) depending on the dimension. It would also be advisable to use the trick here (Determine if the device is a smartphone or tablet?) to determine if you're running on a large/small tablet or a large/small phone.
All in all, it's a little bit painful developing and testing your app on all the available device sizes but as long as you follow the above points, you'll have an easier time.