Phonegap离线缓存网站

时间:2013-03-15 04:02:46

标签: android html5 caching cordova cache-manifest

我有一个配置缓存清单的网站,我将通过phonegap在android中加载。这是我正在使用的以下代码

@Override
public void onCreate(Bundle savedInstanceState)
{
    super.onCreate(savedInstanceState);
    super.loadUrl("http://(192.168.14.46):8080/CacheTest/index.html");

    this.appView.getSettings().setDomStorageEnabled(true);
    this.appView.getSettings().setAppCacheMaxSize(1024 * 1024 * 15);  

 this.appView.getSettings().setAppCacheEnabled(true); 

    String appCachePath = getApplicationContext().getCacheDir().getAbsolutePath();
    this.appView.getSettings().setAppCachePath(appCachePath);
    this.appView.getSettings().setAllowFileAccess(true);
    //this.appView.getSettings().setAppCacheEnabled(true);      

}

当我运行此页面时,页面正在正确加载。然后我转动服务器,我再次运行应用程序。但这次我收到错误,说该网址无法加载。

但是当我在使用Chrome浏览器的PC上尝试相同时它的工作正常,所有项目都在第一次缓存,我可以在服务器关闭的情况下无数次查看网站。

这是否意味着Web视图不支持缓存?或者我错过了什么?

我在三星Galaxy标签的Android 3.0中检查了这段代码。

0 个答案:

没有答案
相关问题