tutorial, no_image, android,

Android - no_image

Upendra Upendra Follow Jan 23, 2025 · 1 min read
Android - no_image
Share this

From the Google-android source code

NoDPInAnyDPI

nodpi: Fallback

  • A drawable inside the res/drawable-nodpi/ folder is valid for any screen density. Eg. drawable-nodpi/ic_icon.png The above icon will will look small on xxxhdpi devices and big on ldpi devices.

    drawable-hdpi/ic_icon.png drawable-nodpi-21/ic_icon.xml In android 21 hdpi devices ic_icon.png will be used and in android 21 xhdpi devices ic_icon.xml will be used.

anydpi: Takeover

  • A drawable inside drawable-anydpi is also valid for any screen density but anydpi variant has more priority over any density specific variant.

    Eg. If we have res/drawable-anydpi/ic_icon.xml and res/drawable-xxxhdpi/ic_icon.png then ic_icon.xml will be used even in xxxhdpi devices.

    -Most of the times -anydpi used in conjunction with other qualifiers. A good example is anydpi-v21 as vector drawables were introduced in android 21 , so after that we usually have res/drawable-anydpi-v21/ic_icon.xml (Vector drawable) and res/drawable-xxhdpi/ic_icon.png. The vector drawable (ic_icon.xml) will be used in all android 21+ devices and ic_icon.png will be used in xxhdpi devices runing in android 4.4 or older

credit goes to @swayangjit
Join Newsletter
Get the latest news right in your inbox. We never spam!
Upendra
Written by Upendra Follow
Hi, I am Upendra, the author in Human and machine languages,I don't know to how 3 liner bio works so just Connect with me on social sites you will get to know me better.