Feature
Document constants used throughout alloy examples. From a default Alloy project use the following controller and global configuration file. *OS_ANDROID* will get through both iOS and Android platforms.
app/config.json
{
"global": {},
"myKeys": { "key1": 1, "key2": 2},
"env:development": {},
"env:test": {},
"env:production": {},
"dependencies": {}
}
Controller
- app/controllers/index.js
function doClick(e) {
//alert($.label.text);
if(OS_ANDROID){
alert('it is android');
}else{
alert('it is not android');
}
}
$.index.open();
I can't reproduce this. Perhaps there's something wrong in the rest of the code you haven't shown. I created a new alloy project, used a simple index.xml and the index.js given above with the config.json. The OS_ANDROID conditional works exactly as expected, showing the appropriate alerts based on the platform. Tested with 0.3.x and 1.0.X branch of alloy and TiSDK 3.0.0.GA. Closing this ticket.