所以我正在使用 PhoneGap 和 jQuery mobile 来构建我的 Android 应用程序,但在我的应用程序中是不显示的 flash swf 电影,我认为这与 PhoneGap 有关。但是我想知道我是否尝试过 HTML5 清单缓存应用程序然后它可能会工作,只是我不完全确定如何去做。我是否仍然可以将其导出为 android 应用程序,我将如何将其作为应用程序呈现在我的设备中?我看过诸如http://www.youtube.com/watch?v=kXZA9eS6nCw之类的教程和 HTML5 应用程序缓存医生,但我仍然发现我的应用程序很难理解。目前我使用 xampp 作为我的网络服务器。我不确定这是否是正确的方法,但这是我迄今为止所做的,我将它们全部放在 htdocs 中的服务器中。
索引.html
<!DOCTYPE html>
<html lang="en" manifest="site.manifest">
<head>
<meta charset="utf-8">
<title>HelloWorld App</title>
<link href="jquery.mobile-1.0.min.css" rel="stylesheet" type="text/css"/>
<script src="jquery-1.6.4.min.js" type="text/javascript"></script>
<script src="jquery.mobile-1.0.min.js" type="text/javascript"></script>
<link rel="stylesheet" href="see.css">
</head>
<body>
<!--background colour-->
<img src="yaa/bluew.jpg" width="1048" height="800">
<div data-role="page" id="page"data-role="page" data-theme="b">
<!--header within the jQuery Mobile data colour theme page b for blue-->
<div data-role="header">
<h1><img src=yaa/header4.png alt="HelloWorld" width="529" height="178"200" /> </h1>
</div>
<div data-role="content">
<ul data-role="listview">
<p>
<object width="710" height="493">
<param name="movie" value="welcome.swf">
<embed src="yaa/welcome.swf"
width="710" height="493"> </embed>
</object>
</p>
<p> <button id="startButton" onclick ="location.href= ('#page2');">Start</button> </p>
</ul>
</div>
<div data-role="footer">
<h4>Welcome To HelloWorld</h4>
</div>
</div>
Site.Manifest 缓存清单
# version 0.2
ind.html
jquery.mobile-1.0.min.css
jquery-1.6.4.min.js
jquery.mobile-1.0.min.js
see.css
"site.manifest" [New] 8L, 74C written
preview.png
.htaccess
AddType text/cache-manifest manifest</p>
" .htaccess" [New] 1L, 37C written
这只是我的 PhoneGap java 代码
package com.helloapp.namespace.myhelloword;
import org.apache.cordova.DroidGap;
import android.os.Bundle;
public class MyPhoneGapActivity extends DroidGap {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
super.setIntegerProperty("splashscreen", R.drawable.splash);
super.loadUrl("file:///android_asset/www/index.html");
}
}
请让我知道我是否朝着正确的方向前进,因为我不太确定如何根据我所介绍的内容使用 HTML5 缓存。如果我完全无视 java,请告诉我,谢谢。