Android image resolution folders

You must Login before you can answer or comment on any questions.

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.

I'm wondering the same thing, can anyone enlighten us? :)

— answered 2 years ago by Vebjørn Berg
answer permalink
2 Comments
  • I'm with him ^^^

    I just took my Appicon and converted it to be the same sizes as the images in those folders, then added "anyDensity='true'" to my tiapp.xml like the console told me.

    — commented 2 years ago by Colton Arabsky

  • so adding:

    <android xmlns:android="http://schemas.android.com/apk/res/android">
            <manifest>
                <supports-screens android:anyDensity="true"/>
            </manifest>
        </android>
    would render images on that folder?

    In my case I used multiple background for my apps, how do I included them for diff resolution?

    — commented 2 years ago by Peter Eman Abastillas

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 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

— answered 2 years ago by Joe Chavez
answer permalink
2 Comments
  • You're using the android SDK level 7 tooling and the property you're trying to use is level 8. From the docs.

    xhdpi: Extra high-density screens; approximately 320dpi. Added in API Level 8

    — commented 2 years ago by Don Thorp

  • Yes, this makes sense... thank you for the quick response!

    — commented 2 years ago by Joe Chavez

It does not help that TiSDK on Android selects images in the wrong order.

https://jira.appcelerator.org/browse/TC-1168

Your Answer

Think you can help? Login to answer this question!