I have an Android app that's going to need the APK Expansion File due to its large size. The problem is that the things making it soo big are the varied image assets (there are tons) in the res/drawable-hdpi and res/drawable-xhdpi folders. I can't control the number of images (client spec), but I need to move these images into the expansion file. Though reading the Google Docs on the expansion file, it doesn't seem that I can place those images into the expansion file and the app will automatically pick the correct image based on the screen density. ie normally all I need to do to get the right image for the density of the phone is just access its resource ID (R.drawable.image), but in the expansion file, it all seems to be reference by files, and not resource IDs. Does anyone know how I can automatically get the images based on density or will I have to write a system for this problem?
Asked
Active
Viewed 520 times
5
-
1In the end I had to write my own system, as there doesn't seem to be a way to do this with expansion files, though I did use the `DisplayMetrics` class to get the reported density of the device. – binglee Jul 06 '13 at 03:30
-
Hey thanks for the question. I'm having the same problem. How did you solve it? Could you help me? Here is my question http://stackoverflow.com/questions/21450510/images-loaded-from-expansion-file-appears-smaller-than-it-should-look – Nazerke Jan 30 '14 at 08:45
-
1Hi, no i did not resolve this as the project went away. I still suspect I would have to write my own resolution handling system for images in the APK. – binglee Jan 30 '14 at 23:32