How Does Titanium Resolve Location of JavaScript Window Files
Hello,
If I have code like this in app.js
:
var loginWindow = Ti.UI.createWindow({
url: "login/login.js",
title: "Login",
barColor: "#FF840F"
});
Apparently, Appcelerator will first look in the platform-specific directory for that file. For example, on Android, it will first look in /Resources/android/login/login.js
for the file. If it isn't found, it will look in /Resources/login/login.js
for the file.
I learned this the rule the hard way when building some screens. Can somebody please point me to where this rule is "officially" documented so I can see if there is anything else I missed? For example, are images also searched this way? What is and isn't searched this way?
1 Answer
-
Accepted Answer
During build time files in the platform directory overwrite the same files in the root directory. So if you're building for Android and have login.js in the android folder that is the one used on Android devices. Same for iPhone only in the iPhone directory. If neither platform directory provides a copy of the file then the one in the root dir is shipped with the app.