在PhoneGap的Andr​​oid项目多个HTML文件 [英] Multiple Html files in PhoneGap Android project

查看:205
本文介绍了在PhoneGap的Andr​​oid项目多个HTML文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个与电话峡,jQuery Mobile的Andr​​oid中使用Eclipse的跨平台应用程序。我一点都没有用我的应用程序的任何PhoneGap的功能。我与PhoneGap的目的是要建立针对iOS原生应用,Android的,窗户等从Adobe的PhoneGap构建服务。在安卓入资产/ WWW /文件夹,我创建了多个子文件夹,如CSS,JS,HTML等,在这里我把我的jQuery Mobile的HTML,CSS,JS文件和我的自定义JS,HTML,CSS。注意:www目录下,我有cordova.js和index.html,科尔多瓦罐子也包括在构建路径。我的应用程序工作正常,当我在Eclipse + Android模拟器中运行它。它产生有效的apk文件并打开我的应用程序根页面welcome.html,这是在www / html等/ welcome.html。问题是,当我上载我的code到Adobe的PhoneGap构建服务生成的Andr​​oid版本,这是给予有效的APK,其安装开放的index.html,这是在WWW / index.html的后面。我我DroidGap actvity,我加载welcome.html而已。

I am developing a cross-platform app with Phone Gap, Jquery Mobile in Android using eclipse. I am not at all using any PhoneGap functions in my app. My purpose with PhoneGap is to build native apps for ios, Android, windows etc from Adobe PhoneGap build service. Under android assest/www/ folder I created multiple sub folders like css,js,html etc, where I put my jquery mobile html,css,js files and my custom js,html,css. Note under www directory I have cordova.js and index.html, cordova jar also included in build path. My app is working fine, when I run it in eclipse + Android emulator. It is generating valid apk and opening my app root page welcome.html, which is under www/html/welcome.html. The problem is when I generated android build by uploading my code to Adobe PhoneGap Build service, it is giving valid apk, which after installing opening index.html, which is under www/index.html. I my DroidGap actvity, i am loading welcome.html only.

  super.loadUrl("file:///android_asset/www/html/welcome.html");

任何建议PLZ。我需要有www目录,因为一些设计上的限制。

any suggestions plz. I need to have multiple html pages and folders under www directory because some design restrictions.

推荐答案

我不知道我是否uderstood你的意思了。

I am not sure if I uderstood what you mean.

也许你可以试试:

$.mobile.changePage('./html/welcome.html');

添加到您的JavaScript事件的监听器,它应该工作。

Add this to your javascript event's listener, it should work.

这篇关于在PhoneGap的Andr​​oid项目多个HTML文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆