I want to provide drawables for:
hvga and qvga phones (but those use hdpi drawables pretty well)
hdpi phones
xhdpi phones
xxhdpi phones
7" tablets
10" tablets
I have folders:
drawable-hdpi (used by phones up to 480x854 screens)
drawable-xhdpi (used by phones like Galaxy S3)
drawable-xxhdpi (used by phones like Galaxy S4)
drawable-sw600dp (I would expect: used by 7" tablets)
drawable-sw720dp (I would expect: used by 10" tablets)
My original problem was, I thought resources from drawable-sw720dp are not used, but they are! Some graphic designer gave me files with different names and I did not notice. My fault.
So no problem at all.
For supporting tablets also, use large, xlarge qualifiers. Nexus 7 is a large-hdpi tablet(technically it's tvdpi, but takes images from hdpi). So if you want to put images for Nexus 7, make a folder named drawable-large-hdpi and put the images there.
Now regarding the 10 inch tablets case, they are xlarge devices and their densities can change from mdpi to xhdpi(Nexus 10). But many have resolution of 1280 * 800 and they are mdpi devices.
Create drawable folder like this
// for Phones
drawable-mdpi
drawable-hdpi
drawable-xhdpi
drawable-xxhdpi
//for 7 inch tablets
drawable-large-mdpi
drawable-large-hdpi(for Nexus 7)
// for 10 inch tablets
drawable-xlarge-mdpi
drawable-xlarge-xhdpi(for nexus 10)
Source of answer
My original problem was, I thought resources from drawable-sw720dp are not used, but they are!
Related
Is there a way to create a drawable folder and a values folder to 420 dpi and 560 dpi devices? One for the 420 dpi and one for 560 dpi.
420dpi: Samsung Galaxy S5, S4, LG G5, ...
560dpi: Nexus 6, Samsung S6, S7, ...
Because in those type of devices my app not looks well. Images in drawable-xxhdpi are smaller in a device with 420 dpi. Because multiplies the width of the image x 2,625 (density). I need bigger images or multiply images x 3.
The solution that I've found is to create a drawable-420dpi and a drawable-560dpi folder and copy xxhdpi and xxxhdpi resources respectively.
I'm not sure that this is the best solution but It works on PIXEL XL, Nexus 5X, 6 and 6p simulators.
This is very frustrating for developers and designers too.
If you using Android Studio, you can easily create a folder width name: mipmap-420dpi and mipmap-560dpi in the folder that same with folders as mipmap-hdpi, mipmap-mdpi, mipmap-xhdpi .... You can see this picture
You can get ppi using DisplayMetrics and after getting ppi you can use IF condition and set that drawable that you need to set.
I am developing an Android application for handsets and tablets. I have images in drawable-mdpi folder for handsets, I have an mdpi tablet that gets resources from drawable-mdpi. How can I make difference between mdpi handsets and mdpi tablets?
simply do it with dimen
for Handset use default values dimens.xml
values-sw600dp for 7 inch Tablate add dimens.xml
values-sw720dp 10 inch Tablate add dimens.xml
also create drawable-sw600dp and drawable-sw720dp
You will find solution in these two links.
For understanding drawable folder properties here
For differentiating tablets and devices here
Hope this helps.
I have a background image of different sizes, 240x320, 320x480, 480x800, 1024x600, 1280x720. I have a drawable-large-mdpi folder that holds 480x800 image, which I use in layout-large and it seems to fit well for screens 5.1", 5.4". From my understanding, layout-large is for screens ranging from 5.1" to 7.3". My question is how to provide a different image of dimension 1024x600 for 7" tablet? Which drawable folder holds this(1024x600) image that i can make use of for 7" tablets?
How could I store 480x800, 1024x600 images in the same folder with same name so that the former can be used on 5.1", 5.4" devices and the later for 7" tablets?
In Eclipse, AVD manager Device Definitions, 5.1", 5.4", 7" devices are specified as Large mdpi. Can i place 1024x600 image in drawable-large-mdpi folder that might scale down for 5.1" and 5.4" devices?
Please help me out. I'm pretty much confused about it.
for 7 inch tablerts you can use
drawable-large-mdpi
drawable-large-hdpi(for Nexus 7)
Should we use XHDPI images for retina display in Android? If not, where should I place images/assets for the Samsung Galaxy S3.
Update:
I found a useful artical:
List of Android Devices with pixel density buckets
The Samsung Galaxy S3 got a density of around 309 pixels per inch. From the Android documentation on supporting multiple screen densities:
xhdpi: Resources for extra high-density (xhdpi) screens (~320dpi)
I think we can conclude that assets for the S3 should be placed in the xhdpi folder.
I'm developing an application which supports xhdpi devices.
so I created layout-xhdpi and drawable-xhdpi folders to place my drawables
and layouts.but I'm having a problem when supporting different resolution in same density.
as an example samsung galaxy nexus and sharp IS003 detects same layout-xhdpi folder because it has same density but when I run the application in both devices,it displays buttons and
images at different positions because both devices got different resolutions.
am I doing something wrong? should I create different folders for specific resolutions?
I have read supporting multiple screens documentation and tried to declare layouts like res/layout-sw600dp/ but it wont detect for IS03.
Please help me to solve this problem.
why you kept drawable-xhdpi?. there is no android tablet with xhdpi.
check here:
all the 10 inch tablet is only mdpi.
if you check your device density it will show only 160dpi for tablet.
there is xhdpi device for normal phone nexus S ICS.
so move all your drawable-xhdpi to drawable-mdpi and check it will work.