If you provide the same image under different file names (even if they are just hard links), the aapt will package them up as separate resources. Rather than using the file system to create hard links, the Android way of doing what you want is to provide alias resources. The technique is described here in the docs. Basically, you simply create a bitmap drawable that references another drawable:
file res/drawable/apple.xml:
<?xml version="1.0" encoding="utf-8"?>
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/apple_something" />
where you store apple_something.png
in the res/drawable directory. The alias resource takes up just a tiny bit of additional room in the .apk file.
In code, both R.drawable.apple
and R.drawable.apple_something
would then retrieve the same image (although they would be different Drawable objects); in xml it would be @drawable/apple
and @drawable/apple_something
.