WebSettings setAppCacheEnabled - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for WebSettings setAppCacheEnabled method.

This code example shows how to use the following methods:setAppCacheEnabled, setDomStorageEnabled
 
    @Override 
    public void applyWebSettings(WebView view) {
        super.applyWebSettings(view);
        WebSettings settings = view.getSettings();
        settings.setAppCacheEnabled(true);
        settings.setDomStorageEnabled(true);
    } 
} 
8
CodeRank
This code example shows how to use the following methods:setAppCacheEnabled, setAppCacheMaxSize, setDatabasePath, setDomStorageEnabled, setGeolocationEnabled
	} 
 
	@SuppressLint("SetJavaScriptEnabled") 
	public void configureSetting(WebViewBridge webViewBridge) {
		WebSettings settings = webViewBridge.getSettings();
		settings.setJavaScriptEnabled(true);
		settings.setJavaScriptCanOpenWindowsAutomatically(true);
		settings.setGeolocationEnabled(true);
		settings.setDomStorageEnabled(true);
		File databasePath = new File(mContext.getCacheDir(), "webstorage");
		settings.setDatabasePath(databasePath.toString());
		settings.setAppCacheEnabled(true);
		settings.setAppCacheMaxSize(1024 * 1024 * 4);
	} 
 
	// for test 
	public void setInjectorHelper(InjectorHelper injectorHelper) {
		mInjectorHelper = injectorHelper;
	} 
 
7
CodeRank
This code example shows how to use the following methods:setAppCacheEnabled, setJavaScriptEnabled
 
		 
		WebView 	view 	 = new WebView(activity);
		WebSettings settings = view.getSettings();  
         
		settings.setJavaScriptEnabled(true);  
		settings.setAppCacheEnabled(false);
         
		view.setWebViewClient( new WebViewClient() {
			@Override 
			public void onPageStarted( WebView view, String url, Bitmap favicon ) {
				if( mLoader == null )
					mLoader = ProgressDialog.show( activity, "", "Loading changelog ..." );
				 
				super.onPageStarted(view, url, favicon);
			} 
 
			@Override 
			public void onPageFinished( WebView view, String url ) {
				super.onPageFinished(view, url);
7
CodeRank
This code example shows how to use the following methods:setAllowFileAccess, setAppCacheEnabled, setAppCacheMaxSize, setAppCachePath, setCacheMode
7
CodeRank
This code example shows how to use the following methods:setAppCacheEnabled, setCacheMode, setDefaultZoom, setLoadWithOverviewMode, setSavePassword
     */ 
    private void setSettings() { 
        // Here we set various settings regarding browser experience. 
        WebSettings settings = webview.getSettings();
        webview.setInitialScale(1);
        settings.setSavePassword(false);
        settings.setCacheMode(WebSettings.LOAD_NO_CACHE);
        settings.setAppCacheEnabled(false);
        settings.setUseWideViewPort(true);
        settings.setLoadWithOverviewMode(true);
        settings.setDefaultZoom(WebSettings.ZoomDensity.FAR);
    } 
 
    /** 
     * Initializes the BedditLoginClient and opens the oAuth2 url to begin the login process. 
     */ 
    private void openAuthBrowser() { 
        // Initialize the webClient 
        BedditLoginClient client = new BedditLoginClient(this);
        client.addUrlListener(this);
6
CodeRank
This code example shows how to use the following methods:setAllowFileAccess, setAppCacheEnabled, setAppCacheMaxSize, setAppCachePath, setCacheMode
    public void setAppCachedPolicy(WebSettings settings) {
        File file = new File(mCachePath);
        if( !file.exists() ) {
            file.mkdirs();
        } 
        settings.setAppCachePath(mCachePath);
        settings.setAppCacheMaxSize(BUFFER_SIZE);
        settings.setAppCacheEnabled(true);
        settings.setAllowFileAccess(true);
        settings.setCacheMode(WebSettings.LOAD_NO_CACHE);
    } 
 
    /** 
     * 清除app的缓存数据,例如online模式清除离线缓存数据及localStorage信息 
     * @param app[in] 
     * @param context[in] 
     */ 
    public void clearAppData(XApplication app, Context context) {
    } 
 
6
CodeRank
This code example shows how to use the following methods:setAppCacheEnabled, setAppCacheMaxSize, setDatabasePath, setDomStorageEnabled, setGeolocationEnabled
	} 
 
	@SuppressLint("SetJavaScriptEnabled") 
	public void configureSetting(WebViewBridge webViewBridge) {
		WebSettings settings = webViewBridge.getSettings();
		settings.setJavaScriptEnabled(true);
		settings.setJavaScriptCanOpenWindowsAutomatically(true);
		settings.setGeolocationEnabled(true);
		settings.setDomStorageEnabled(true);
		File databasePath = new File(mContext.getCacheDir(), "webstorage");
		settings.setDatabasePath(databasePath.toString());
		settings.setAppCacheEnabled(true);
		settings.setAppCacheMaxSize(1024 * 1024 * 4);
	} 
 
	// for test 
	public void setInjectorHelper(InjectorHelper injectorHelper) {
		mInjectorHelper = injectorHelper;
	} 
 
6
CodeRank
This code example shows how to use the following methods:setAppCacheEnabled, setCacheMode, setDomStorageEnabled, setJavaScriptEnabled, setSaveFormData
This code example shows how to use the following methods:setAppCacheEnabled, setDatabaseEnabled, setDatabasePath, setDomStorageEnabled, setJavaScriptEnabled
This code example shows how to use the following methods:setAppCacheEnabled, setAppCacheMaxSize, setAppCachePath, setDatabaseEnabled, setDatabasePath
		wb.loadUrl(HTML_TESTS_URL);
		 
		WebSettings webSettings = wb.getSettings();
		 
		//page needs javascript enabled to run 
		webSettings.setJavaScriptEnabled(true);
		 
		if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ECLAIR_MR1) {
			webSettings.setDomStorageEnabled(true);
			webSettings.setAppCacheEnabled(true);
			webSettings.setAppCachePath(getCacheDir().getAbsolutePath());
	        webSettings.setAppCacheMaxSize(1 * 1024 * 1024);
		} 
		 
		if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ECLAIR) {
	        webSettings.setDatabaseEnabled(true);
	        webSettings.setDatabasePath("/data/data/" + getPackageName() + "/databases");
		} 
		 
		//show content 

6
CodeRank

Related WebSettings setAppCacheEnabled Questions & Answers:

setAppCacheEnabled Method Overview
Sets whether the Application Caches API should be enabled.
See Code Examples for other Android WebSettings Methods: