0

In my application I have to use hundreds of bitmap icons and we want to support multiple screen.

And through the documents at android developer, it seems that it is the only way to create these icons for different devices with different dpi.

If this is true, we will have a hard work, so I want to know if there is an alternative to avoid this?

hguser
  • 35,079
  • 54
  • 159
  • 293

4 Answers4

0

You don't have to provide different bitmap resources for all possible pixel densities, but ideally you would provide low dpi (ldpi), medium dpi (mdpi), high dpi (hdpi) and extra-high dpi (xhdpi) icon resources. If you don't provide all of the above, the Android system will automatically pick the closest matching resource and scale it to match the actual screen pixel density.

Rob K
  • 294
  • 2
  • 10
0

Given the number of icons that you're dealing with, creating multiple versions of each manually is clearly out of the question.

I suggest that you create your icons at the xhdpi resolution, and come up with an automated process (perhaps using something like ImageMagick, and the scripting language of your choice) to produce the lower resolutions as part of your build process.

GreyBeardedGeek
  • 29,460
  • 2
  • 47
  • 67
0

Please visit Android Asset Studio wherein this site will provide all types of dp icon images of your requirement.

In your case, go for Generic icons section or Menu icons section.

Hope this helps.

CRUSADER
  • 5,486
  • 3
  • 28
  • 64
  • In fact, the application we are working is something like the google map. And we draw different icons for different kinds of tags. For example, a `park` and a `school` will have the different icons. But thank you for your sites any way, I think I will use it one day. – hguser May 04 '13 at 02:05
0

You can put your images in /res/drawable, then Android would scale them according to dpi in order to keep the image to be roughly the same physical size regardless of display density. In this case an image would be unmodified in MDPI, 1.5x larger in HDPI, 2x larger in XHDPI, and 3x larger in XXHDPI.

You can also put them in /res/drawable-nodpi, in which case no image rescaling would be applied, but it is hardly ideal as the same image would be physically 3x smaller in XXHDPI than in MDPI.

All of the above methods have serious cons, so really the most sensible method is to put the correct sized images in their respective DPI folders. Your images should be drawn in a much larger resolution, so it should just be a matter of rescaling each image to different DPI sizes.

Kai
  • 15,284
  • 6
  • 51
  • 82