Search code examples
androidappceleratorappcelerator-titanium

How to organize image files of different sizes (devices) in a Appcelerator Titanium project


I have recently started creating an Android application using Appcelerator's Titanium.

Since in the application I requires to keep several images/icons with different sizes & dimensions essentially, So I need some advice on how I should organize them in the project.

And as you know like in Android project (Android studio or Eclipse with Android SDK) there is a predefined folder structure so if you want to keep any image then put them in all device sizes corresponding to the prescribed folders. So based on device sizes it will automatically detect corresponding dimension image from device preferable folder.

So does same approach can we achieve in Appcelerator's Titanium ?

Below is the default project structure for Appcelerator's Titanium project (5.1.2.GA)

As you can see there is 2 places where I can keep images. So can you suggest me where I can keep my images and how can I access them
enter image description here

Thanks, Any suggestion will be helpful for me. ~Chandan


Solution

  • The first part is used to be more specific about when these resources should be used. Images in sub-directories give us more control over when they are used.For example images that are in a folder named "res-long-land-hdpi" will be used for:

    Long screens, such as WQVGA, WVGA, FWVGA
    
    Device is in landscape orientation (horizontal)
    
    High-density screens; approximately 240dpi.
    

    Documentation Link