[英]appcelerator - convert windows app to mobile app
我用appcelerator為Windows制作了一個很棒的應用程序,我想將其轉換為移動版(android)。
問題是,與在默認啟動器為“ index.html”且可以將所有javascript / css / html混合在一起的Windows中創建應用程序不同,移動默認啟動器為app.js。
我嘗試了以下方法:
var webview = Titanium.UI.createWebView({
url : 'index.html'
});
var window = Titanium.UI.createWindow();
window.add(webview);
window.open({modal:true});
這很好用,但是我正在index.html內部使用的所有api都沒有在運行,它只是警告錯誤(未定義)。
有人知道如何解決此問題嗎?
編輯:我在我的應用程序中只有兩個API:
var db = Titanium.Database.open('app_data');
var device_id = Titanium.Platform.id;
您無權從網絡視圖訪問所有API,請參見下面的鏈接
http://developer.appcelerator.com/question/8991/webview-usage-guideline
您將需要在js文件中執行大部分業務邏輯,並通過事件機制將數據從應用程序移動到ui級別
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.