user1744147
user1744147

Reputation: 1147

Android app launcher icon size issue

Our app manifest launcher icon in xml file drawable\icon.xml:

<?xml version="1.0" encoding="utf-8"?>
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
    android:src="@drawable/icon_beta"/>

The xml file gets modified at build time to point to either icon_beta or icon_prod.

<application android:icon="@drawable/icon"

Both icon_beta.png and icon_prod.png exist in all resolutions. However, we found that on xhdpi device hdpi icon is used instead of xhdpi. If we reference the icon directly without xml file

<application android:icon="@drawable/icon_beta"

then correct xhdpi icon is used.

Why using the xml drawable affects which resolution is used?

Upvotes: 1

Views: 1348

Answers (2)

drdaanger
drdaanger

Reputation: 360

I found that, specifically for the Nexus 7, specifying a resource in drawable-tvdpi the same dimensions as drawable-hdpi (72p) fixes this issue. I don't know why :(.

Upvotes: 1

petey
petey

Reputation: 17170

The nexus 7 is not an xhdpi device, it has a PPI of 216 and is well within the hdpi 240 DPI bucket.

See this image (fig 1 from http://developer.android.com/guide/practices/screens_support.html )

dpi bucket ranges

Upvotes: 0

Related Questions