I have PSD
, resolution of that is 1080X1920
, it contains a Dot
image whose resolution is 22X22
.
I have cropped that image and put it in my res
folder.
My question is how would Android know that the image is for 1080X1920
screen. It would open the same image bigger in small
screen and smaller in 2560x1440
resolution.
Is there a way other than putting different images for each screen sizes to tell android to use the image for specific screen size and scale for other screens
Android Studio has a plugin called "Batch Drawable" install in your Android studio. This help to create images of different size.
Steps To import: File-->Settings-->Plugin-->Browse Repositories-->Click install button.
Restart your Android studio, then you will be able to find "Batch Drawable" inside the file menu of Android Studio.
Link: https://github.com/winterDroid/android-drawable-importer-intellij-plugin
use directly https://romannurik.github.io/AndroidAssetStudio/
You have to create different dimen , layout , images and icon files to support all devices.
changes in screen density.
Make this layout files, so that it will be same for all devices.
Give padding ,margin ,font and all properties as per devices.
For Layout ,
For Images
For Icon
For Launcher icon
Checkout Dimension and Supporting Multiple Screens Official Documentaion.
There is no more you have to do, just put the different resolution files into different drawable-xxx file is okay. Remember that all the pics MUST HAVE the same name but Android will not automatically to match the screen size for each pic is the file name is not matched. Good luck!
put largescale image in drawable folder.