I have titanium mobile app. In this app i have a webview, in which i have local html file. In this html file i call JS function from a local js file. In this js file i would like to call titanium function like:
var fileName = 'test.json';
var file = Titanium.Filesystem.getFile(Titanium.Filesystem.applicationDataDirectory, fileName);
alert(file);
But alert is not going, i suppose because it doesn't know Ti function inside JS.
What is the best way for such cases?
All my app is based on the webviews and i use small JS tricks inside html, but it's necessary for me to contact with Titanium also and it's annoying to make it all through fire\listen events as in appcelerator docs...