Android image resolution folders
The docs say to create high/med/low directories within the PROJECT/Resources/android/images folder. I just created a new Titanium project using the 1.6 branch of the SDK and I got these folders:
res-long-land-hdpi
res-long-land-ldpi
res-long-port-hdpi
res-long-port-ldpi
res-notlong-land-hdpi
res-notlong-land-ldpi
res-notlong-land-mdpi
res-notlong-port-hdpi
res-notlong-port-ldpi
res-notlong-port-mdpi
So I can guess the land/port differences and the Android dev docs explain the ldpi/mdpi/hdpi (low/med/high) differences. But, what's the difference between long and notlong. And there aren't long-port-mdpi and long-land-mdpi directories…can I or should I create them if I need medium res images?
6 Answers
-
Accepted Answer
I read http://developer.android.com/guide/practices/screens_support.html a bit more and found the answer … long and notlong refer to the aspect ratio. So, long is for "screens of any size or density that have a significantly taller (in portrait mode) and wider (in landscape mode) aspect ratio than the baseline screen configuration." And notlong is the opposite.
-
Are there any guidelines for what to do for a tablet-sized (1280x800) image? Whatever folder/naming convention I use, it just seems to be stretching a smaller image instead.
-
Not having a tablet to test with, I'm going to have to take an educated guess. Looking at http://developer.android.com/guide/practices/screens-distribution.html and http://developer.android.com/guide/topics/resources/providing-resources.html I believe you'll need to create a pair of directories: res-notlong-port-xhdpi and res-notlong-land-xhdpi and put your specific resources in there (e.g. splash screens). I think you'll need to add the <compatible-screens> and/or <supports-screens> tags to your AndroidManifest as described in the first link above.
Of course, once you test this and find the actual answer, please post back here so we'll all learn!
-
I'm wondering the same thing, can anyone enlighten us? :)
-
I tried this and could not get past the build stage:
[TRACE] Writing out AndroidManifest.xml
[DEBUG] /Users/jchavez/Projects/izenme/Development/ext/android/android-sdk-mac_x86/platforms/android-7/tools/aapt package -m -J /Users/jchavez/Projects/AlertId/projects/AlertID/root/trunk/build/android/gen -M /Users/jchavez/Projects/AlertId/projects/AlertID/root/trunk/build/android/AndroidManifest.xml -S /Users/jchavez/Projects/AlertId/projects/AlertID/root/trunk/build/android/res -I /Users/jchavez/Projects/izenme/Development/ext/android/android-sdk-mac_x86/platforms/android-7/android.jar
[ERROR] Error generating R.java from manifest
[ERROR] invalid resource directory name: /Users/jchavez/Projects/AlertId/projects/AlertID/root/trunk/build/android/res/drawable-notlong-xhdpi -
It does not help that TiSDK on Android selects images in the wrong order.
https://jira.appcelerator.org/browse/TC-1168