Search code examples
androidresourcesscreen-size

Android resource folder for exact screen size


Starting from Android 3.2 I have this strange problem.

It's very easy to reproduce:

  1. Create an empty project;
  2. Add values-480x320/ resource directory to it;
  3. Change some string in this new folder, e.g. @string/hello, to be different from default one inside the values/ directory.

Now, on 3.1 and lower Android devices and emulators, everything is as you'd expect it to be. But on 3.2 and higher (including 4.x Galaxy Nexus and emulators), values-480x320/ is used instead of values/ folder!!

It's worth to mention that I don't see that compatibility "Stretch/Zoom to fill screen" icon. I tried changing supports-screens and uses-sdk tags in AndroidManifest.xml but they won't fix this problem.

So my question is: why is this happening and what can you advice to fix it?

PS, I really don't see any reason why such a minor change in Android version from 3.1 to 3.2 has to break older apps!!

Thanks in advance!


Solution

  • In case you're interested: the advice is basically not to use fixed resolution-based resource folders like values-480x320.