By the way, you do not have to duplicate the image resource if you want to use the same one in 2 or more different folders. You can use aliases:
Creating alias resources When you have a resource that you'd like to use for more than one device configuration (but not for all configurations), you do not need to put the same resource in each alternative resource directory. Instead, you can (in some cases) create an alternative resource that acts as an alias for a resource saved in your default resource directory. Note: Not all resources offer a mechanism by which you can create an alias to another resource. In particular, animation, menu, raw, and other unspecified resources in the xml/ directory do not offer this feature. For example, imagine you have an application icon, icon.png, and need unique version of it for different locales. However, two locales, English-Canadian and French-Canadian, need to use the same version. You might assume that you need to copy the same image into the resource directory for both English-Canadian and French-Canadian, but it's not true. Instead, you can save the image that's used for both as icon_ca.png (any name other than icon.png) and put it in the default res/drawable/ directory. Then create an icon.xml file in res/drawable- en-rCA/ and res/drawable-fr-rCA/ that refers to the icon_ca.png resource using the <bitmap> element. This allows you to store just one version of the PNG file and two small XML files that point to it. (An example XML file is shown below.) Drawable To create an alias to an existing drawable, use the <bitmap> element. For example: <?xml version="1.0" encoding="utf-8"?> <bitmap xmlns:android="http://schemas.android.com/apk/res/android" android:src="@drawable/icon_ca" /> If you save this file as icon.xml (in an alternative resource directory, such as res/drawable-en-rCA/), it is compiled into a resource that you can reference as R.drawable.icon, but is actually an alias for the R.drawable.icon_ca resource (which is saved in res/ drawable/). (taken from http://developer.android.com/guide/topics/resources/providing-resources.html) On May 25, 8:27 am, "Michael A." <[email protected]> wrote: > I have people complaining about apk size often enough as it already. > Having duplicateresourcesfor mdpi displays is not really a viable > solution for graphically heavy apps like games. > > The solution I followed was to use drawable and drawable-hdpi-v4. > > Regards, > > Michael A. > > On May 24, 9:52 pm, Mark Murphy <[email protected]> wrote: > > > > > Xavier Ducrohet wrote: > > > The short of it: 1.5 does not know about -mdpi -hpdi, so it'll take > > > the first one it finds which could be the wrong one (which means it'll > > > get scaled). > > > FWIW, the solution given in that presentation was to have both -mdpi and > > -mdpi-v3, with duplicateresources. -mdpi-v3 would be picked up by > > Android 1.5; -mdpi would be picked up by newer versions of Android that > > are legitimately running mdpi displays. > > > -- > > Mark Murphy (a Commons > > Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy > > > Warescription: Three Android Books, Plus Updates, One Low Price! > > > -- > > You received this message because you are subscribed to the Google > > Groups "Android Developers" group. > > To post to this group, send email to [email protected] > > To unsubscribe from this group, send email to > > [email protected] > > For more options, visit this group > > athttp://groups.google.com/group/android-developers?hl=en > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group > athttp://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

