Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can Eclipse automatically generate different DPI images for Android projects?

I'm trying to import a 600x600 PNG I made into my Android project so that I can use it as a full-sized image in an Activity. Dragging and dropping it onto my /res folder just puts it in that folder, which of course generates an "invalid resource directory name" error. I can drop it into any of the /res/drawable folders and that works fine, except then it's only in that one folder. Surely, there's an inbuilt tool which can take my image and scale it appropriately for each /res/drawable folder.

like image 428
flyingsandwich Avatar asked Dec 27 '22 06:12

flyingsandwich


1 Answers

AFAIK there isn't.

What you can do though, is use the drawable-xhdpi folder only. Android will automatically scale down for lower dpi.

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

You can find the needed sizes in the Icon Design Guidelines.


It is important to note that the ADT plugin does have tools for generating some icons sets, such as Launcher icons, Actionbar icons and Notification icons.

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

like image 199
Benito Bertoli Avatar answered Feb 02 '23 06:02

Benito Bertoli