Can I put images only in xxhdpi folder

209 Views Asked by At

I have an app with some images exists only in the xxhdpi folder. When I try to access to those imagse, through context.getResources(...) I see in some phones it crash.

is it possible that it crash because those phones doesn't supports the density in xxhdpi and therefore it cannot find them? or even though the phone is not in density for xxhdpi, it still needs to find it, so it doesn't matter?

In bottom line, my question is what happens if I put some images only in xxhdpi folder, and the phone doesn't supports by default in xxhdpi resolution?

3

There are 3 best solutions below

0
snachmsm On BEST ANSWER

this isn't best solution to MOVE pretty big image file from xxhdpi to default folder as accepted answer suggests... it will be scalled everytime when it will be fetched, so on xxhdpi devices it will be scaled-up 3x - unnecessary work. besides that some old devices may have problem with loading such big picture, due to max bitmap size limitation. it would be better to COPY this file to mdpi folder and rescale it in there (3x smaller) - on xxhdpi will be used original one, on all other scaled version, but not so enormous

ofc best way is to put properly scaled image in every density bucket

0
Mohamed AbdelraZek On

Yes, it will crash, instead you can put them inside default folder which is Drawable.

0
Vijay Patole On

If it is really a big image and you want to use it, then put it in nodpi folder. And if it is a normal image then it is better to scale images with different sizes and put them in a respected folder.