views:

16

answers:

1

Hello,

I made a great app for windows with appcelerator and I want to convert it to mobile (android).

Problem is, unlike creating an app in windows where the default launcher is "index.html" and I can have all my javascript/css/html mixed in together, the mobile default launcher is app.js.

I've tried the following:

var webview = Titanium.UI.createWebView({
    url : 'index.html'
});

var window = Titanium.UI.createWindow();
window.add(webview);
window.open({modal:true});

This works great however none of the api's I'm using inside of index.html are being run, it just alerts an error (undefined).

Does anyone know how to fix this issue?

EDIT: There are only two API's I'm using in my app:

var db = Titanium.Database.open('app_data');
var device_id = Titanium.Platform.id;
A: 

you dont have access to all of the API from the webview, see link below

http://developer.appcelerator.com/question/8991/webview-usage-guideline

you will need to do most of your business logic in the js files and through the event mechanisms move data from you app to the ui level

Aaron Saunders