mWebSettings.setAppCacheMaxSize(Long.MAX_VALUE);
webview1 = (WebView) findViewById(R.id.webView1); WebSettings webSettings = webview1.getSettings(); webSettings.setJavaScriptEnabled(true); webSettings.setCacheMode(WebSettings.LOAD_NORMAL); <--- CHANGE THIS webSettings.setAppCacheMaxSize(1024*1024*8); webview1.addJavascriptInterface(new JavaScriptInterface(this), "Android"); webview1.setWebViewClient(new MyWebViewClient()); webview1.setBackgroundColor(Color.BLACK); try { current_url = "http://........link"; webview1.loadUrl(current_url); } catch (Exception e) { Log.v("Loading Webview Failed", "Loading the webview Failed"); } current_fact = 0;
webView.setInitialScale(0); webView.setVerticalScrollBarEnabled(false); // Enable JavaScript final WebSettings settings = webView.getSettings(); settings.setJavaScriptEnabled(true); settings.setJavaScriptCanOpenWindowsAutomatically(true); settings.setLayoutAlgorithm(LayoutAlgorithm.NORMAL); // Enable AppCache // Fix for CB-2282 settings.setAppCacheMaxSize(5 * 1048576); settings.setAppCachePath(databasePath); settings.setAppCacheEnabled(true);
browser.getSettings().setLoadsImagesAutomatically(true); browser.getSettings().setJavaScriptEnabled(true); browser.getSettings().setAppCacheMaxSize(1024 * 1024 * 8); browser.getSettings().setAppCachePath(Environment.getDataDirectory() + "/data/com.marz.snapprefs/cache/"); browser.getSettings().setAppCacheEnabled(true);
public void importPhoneGapUser() { String databasePath = getApplicationContext().getDir("database", Context.MODE_PRIVATE).getPath(); String pathToCache = getApplicationContext().getDir("database", Context.MODE_PRIVATE).getPath(); WebView mAuthWebView = new WebView(this); WebSettings webSettings = mAuthWebView.getSettings(); webSettings.setDatabasePath(databasePath); webSettings.setAppCachePath(pathToCache); webSettings.setGeolocationDatabasePath(databasePath); webSettings.setAppCacheMaxSize(5 * 1048576); webSettings.setAppCacheEnabled(true); webSettings.setDatabaseEnabled(true); webSettings.setJavaScriptEnabled(true); webSettings.setDomStorageEnabled(true); mAuthWebView.addJavascriptInterface(new MyJavaScriptInterface (), "JsInterface"); //i wasn't able to run JS through 'javascript:' protocol, so i had to use a HTML file mAuthWebView.loadUrl("file:///android_asset/import_auth.html"); }
webSettings.setAppCacheMaxSize(Long.MAX_VALUE);
webView.getSettings().setAppCacheMaxSize(5 * 1024 * 1024); // 5 MB
webSettings.setSupportMultipleWindows(true); webSettings.setBuiltInZoomControls(true); webSettings.setAppCacheMaxSize(1); webSettings.setCacheMode(WebSettings.LOAD_NO_CACHE); webSettings.setAppCacheEnabled(false);
@SuppressLint("SetJavaScriptEnabled") private void initWebViewSetting() { mWebView.setVerticalScrollBarEnabled(false); mWebView.setHorizontalScrollBarEnabled(false); WebSettings webSetting = mWebView.getSettings(); webSetting.setJavaScriptEnabled(true); webSetting.setAllowFileAccess(true); webSetting.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS); webSetting.setSupportZoom(false); webSetting.setBuiltInZoomControls(false); webSetting.setUseWideViewPort(true); webSetting.setSupportMultipleWindows(false); webSetting.setLoadWithOverviewMode(true); webSetting.setAppCacheEnabled(true); webSetting.setDatabaseEnabled(true); webSetting.setGeolocationEnabled(true); webSetting.setDomStorageEnabled(true); webSetting.setAppCacheMaxSize(Long.MAX_VALUE); webSetting.setAppCachePath(getDir("appCache", Context.MODE_PRIVATE).getPath()); webSetting.setDatabasePath(getDir("databases", Context.MODE_PRIVATE).getPath()); webSetting.setGeolocationDatabasePath(getDir("geolocation", Context.MODE_PRIVATE).getPath()); webSetting.setPluginState(WebSettings.PluginState.ON); webSetting.setRenderPriority(WebSettings.RenderPriority.HIGH); webSetting.setTextSize(WebSettings.TextSize.NORMAL); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { webSetting.setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW); } mWebView.loadUrl(mUrl); }
ws.setAppCacheEnabled(true); ws.setAppCacheMaxSize(1024 * 1024 * 8);
settings.setAppCacheMaxSize(5 * 1048576); settings.setAppCachePath(databasePath); settings.setAppCacheEnabled(true);
settings.setAppCacheMaxSize(5 * 1048576); settings.setAppCachePath(databasePath); settings.setAppCacheEnabled(true);
settings.setDatabaseEnabled(true); settings.setDomStorageEnabled(true); settings.setAppCacheMaxSize(1024*1024*1024*8); String sDataPath = context.getDir("database", Context.MODE_PRIVATE).getPath(); settings.setDatabasePath(sDataPath);
mWebSettings.setDatabasePath(appCacheDir); mWebSettings.setAppCachePath(appCacheDir); mWebSettings.setAppCacheMaxSize(1024*1024*80);
mWebSettings.setAppCacheMaxSize(Long.MAX_VALUE);
settings.setJavaScriptEnabled(true); settings.setAppCacheEnabled(true); settings.setAppCacheMaxSize(10*1024*1024); settings.setAppCachePath(""); settings.setDatabaseEnabled(true);