indexeddb sqlite localStorage sessionStorage 四种
indexeddb是一种nosql数据库
android 启用数据库webView 设置参数
支持sqlite
String dir=this.getApplicationContext().getDir("contactdb", Context.MODE_PRIVATE).getPath();
webView = new WebView(this);
WebSettings settings = webView.getSettings();
settings.setJavaScriptEnabled(true);
settings.setDatabaseEnabled(true);
settings.setDatabasePath(dir);
支持localStorage
mWebView.getSettings().setDomStorageEnabled(true);
mWebView.getSettings().setAppCacheMaxSize(1024*1024*8);
String appCachePath = getApplicationContext().getCacheDir().getAbsolutePath();
mWebView.getSettings().setAppCachePath(appCachePath);
mWebView.getSettings().setAllowFileAccess(true);
mWebView.getSettings().setAppCacheEnabled(true);
这个测试了是可以的
- // 开启DOM缓存。
- wvBrowser.getSettings().setDomStorageEnabled(true);