Can Eclipse automatically generate different DPI images for Android projects?

I am trying to import a 600x600 PNG that I made in my Android project in order to use it as a full-size image in Activity. Dragging it to the my / res folder just puts it in this folder, which, of course, generates the error "invalid resource directory name". I can put it in any / res / drawable folder, and this works fine, except that it is in only one folder. Of course, there is a built-in tool that can display my image and scale it accordingly for each / res / drawable folder.

+4
source share
4 answers

AFAIK no.

However, you can only use the drawable-xhdpi . Android will automatically decrease to reduce dpi.

The only exception is the launch icon. You will need to provide all sizes (don't forget xxhdpi for tablets!).

You can find the sizes you need in the Icon Design Guide .


It is important to note that the ADT plugin has tools for creating some icon sets, such as Launcher icons, Actionbar icons, and notification icons.

These tools can be accessed by opening a new wizard (Ctrl + N) and double-clicking the Android Icon Set icon in the Android category.

+5
source

There is a built-in tool that can take my image and scale it accordingly for each / res / drawable folder.

For the zoom part, check out the @ Android Asset Studio Icon Generator Tools. There are tools for creating Launcher icons, tab icons, action bar icons, and (in your case) common icons.

+2
source

If you place your resources in / res / drawable, this resource will be used for all devices.

However, he probably won’t do what you want. I would recommend scaling assets yourself. If this is not a viable option, then you are stuck letting Android do the scaling for you.

+1
source

Fortunately, this has changed - now you can auto-generate different densities - take a look at: https://code.google.com/p/android-drawable-converter/

+1
source

Source: https://habr.com/ru/post/906437/


All Articles