Hi as per android documentation the drawable folder needs to have multiple sub-directories for images of different dpis. However in Android Studio creating any sub directory in the drawable folder causes it to fail to detect any images at all. On the other hand if an image is placed directly in the drawable folder it gets detected and becomes available for use view R.drawable.ImageName. In this case how do we use different dpi images for the same ImageName?
Step 1: In this method first of all in your system find your required images and copy the image as we do normally. Step 2: Then open the Android Studio go to the app > res > drawable > right-click > Paste as shown in the below figure. Step 3: Then a pop-up screen will arise like below.
Go to the solution explorer, select Resource--> drawable. Right click --> add--> Existing Item. or (Shift + Alt + A).
The standard procedures are:
There are two ways of doing it.
1.Right click on drawable New->Image Asset-> select your highest resolution image rest will be created automatically. once you finish you can see different resolution inside drawable folder
Now yourprojectname->app->src->main->res->
Aila You can see your drawable folders with hdpi mdpi etc.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With