AppMobi需要您的web應用程序,使用他們的預建模板進行編譯,併爲您提供生成的APK。請確保您使用自定義加載啓動圖像並在論壇中實施hack解決方法以加速首次加載。
你不需要做任何事情,但創建一個新的項目,並粘貼您的web應用到項目文件夾,然後按照屏幕截圖。 And that hack I mentioned.
如果你有或瞭解gradle這個,我這樣做是爲了防止污染的實際網絡應用:
task appmobi(dependsOn: [buildForWeb]) << {
File indexFile = new File('build/index.html')
def appMobiLoader = '''<script type="text/javascript" src="http://localhost:58888/_appMobi/appmobi.js"></script>
<script type="text/javascript">
function deviceReadyListener() {
AppMobi.device.hideSplashScreen();
}
window.document.addEventListener("appMobi.device.ready", deviceReadyListener, false);
</script>'''
def indexText = indexFile.text.replace("</head>", "$appMobiLoader</head>")
indexFile.withWriter { writer ->
writer.write(indexText)
}
}