I have tablet with 1024 x 720 screen resolution and density is 160 dip (medium) this tablet is different from others, I have tried to search on here and here too but I could not find any proper solution so kindly suggest me which type of folder will be use for layouts as well as drawable.
Asked
Active
Viewed 154 times
2 Answers
0
A way to find that out is to put different images with same name under the folders mdpi, hdpi, xhdpi & xxhdpi and then you will know which folder it is using

Sarthak Mittal
- 5,794
- 2
- 24
- 44
-
thanks for reply, I have to create layouts only for this resolution. – Hiren Patel Nov 28 '14 at 07:07
-
so considering that the drawable problem is resolved, now coming to layouts, you can fetch the resolution of the phone at runtime, and if it is 1024x720 then use your custom layout in setContentView – Sarthak Mittal Nov 28 '14 at 07:11
0
Best solution depends on Android version.
For android 3.2+ you could use folders like drawable-sw720dp and layout-sw720dp.
For android versions lower than 3.2 only way is to check resolution in code
public void onCreate(){
if (windowWidth == 720){
setContentView(R.layout.layout_720dp);
} else {
setContentView(R.layout.layout_default);
}
}
Any way you should avoid this methods and use RelativeLayout and/or ScrollView to handle wide range of devices in one xml layout.

Stepango
- 4,721
- 3
- 31
- 44