I have a project which have following folder structure
Resources/
android/
images/
res-hdpi/
main.png
res-mdpi/
main.png
res-ldpi/
main.png
iphone/
images/
images/
main.png
main@2x.png
ui/
MainView.js
MainView.js is writing in commonjs fashion
function MainView()
{
var self = Ti.UI.createImageView({
height : '25dp',
width : '25dp',
image : 'images/main.png'
});
return self;
}
module.exports = MainView;
Those code perform as expacted in iOS but not the same story in Android.
I expected in high resolution device, it will load android/images/res-hdpi/main.png as a image but it keeps saying path not found.
I am using Titanium SDK 1.8.2
I don’t know if you ever resolved this or not, but your tiapp.xml file has state that your application supports these densities. Also, after adding the images to /android/images, you have to clean the project to force a rebuild. The build process indexes the images and creates a resource file with the file name and an integer value (which is also why the file name cannot start with a number).