Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android graphics for XXHDPI

I'm about to adjust all drawables for an Android app for XXHDPI devices (like sony xperia Z and samsung s4). After thorough reading on Google's documentation, blogs, and SO, I'm confused as to the graphics I'm about to produce.

My concerns are the following:

  1. Google states that I shouldn't worry about this density as it scales up XHDPI graphics - In the same manner, (before XXHDPI devices) why the production of XHDPI graphics was a necessity and it didn't scale up HDPI graphics?

  2. Sony reminds developers not to exclude XXHDPI screens without clarifying if this concerns making adjustments to graphics - Do I have to redesign all graphic elements for XXHDPI?

  3. Based on (2), Sony Xperia Z Ultra has 342dpi density but it is categorized as an XXHDPI device. - If I produce the graphics for an XXHDPI, which is twice the size of an HDPI density, the graphics will scale down by almost 1/3 to match Sony's density and this is undesirable. Why doesn't Xperia Z use the XHDPI drawables? What if I have a pattern and I can't afford any scaling since I'll lose the detail of the pixel-perfect pattern?

  4. Are XXHDPI resources REALLY necessary?

I hope somebody can answer all the questions above.


EDIT

Below are the results of slightly scaling a graphic to adjust to various densities

XHDPI pattern - xhdpi image (1:1) no scaling

XHDPI scaled up by 10% - xhdpi scaled up by 10%

XHDPI scaled down by 10% - xhdpi scaled down by 10%

The detail loss is obvious at 2nd and 3rd image.

like image 846
otinanai Avatar asked Jun 28 '13 12:06

otinanai


People also ask

Is dp the same as PX?

A dp is equal to one physical pixel on a screen with a density of 160.

What is difference between SP and dp in Android?

The sp unit is the same size as dp, by default, but it resizes based on the user's preferred text size.

What is 4x pixel density?

In 4x screen (~640 DPI) it takes four times as many pixels (352 x 144 PX) to fill the area of 88 x 36 density-independent-pixels.


2 Answers

  1. Unless you actually need your graphics to be "pixel perfect", scaling up from XHDPI will probably be fine for almost all cases. Pixels are so small the user won't be able to tell the difference. Do you actually have an XXHDPI device you can see your graphics on? You might have to provide XXHDPI resources for some drawables, just like you sometimes have to provide MDPI drawables when the HDPI ones don't scale down well.
  2. "do not exclude" in this context means explicitly from the manifest. Some developers target densities in their manifest and that will affect the app not showing in the Play store, this is unrelated to actual graphics.
  3. From that same page, it actually says that the density of that device is 440 dpi? - "One of the awesome features you’ll find in the recently announced Sony Xperia Z is its 5” screen, which boasts a display density of 440 dpi,"
like image 93
dmon Avatar answered Sep 27 '22 19:09

dmon


XXHDPI resources are essential for stuff like icons on modern devices. Google will change their story and start to recommend them when they release their own XXHDPI Nexus device.

Think about it this way: xxhdpi devices are pretty much the STANDARD Android devices. Little chance Samsung & HTC are going to roll everything back to XHDPI just because Google can't keep up.

like image 43
radley Avatar answered Sep 27 '22 18:09

radley