Android WebSettings - top ranked examples from Open Source projects

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

This code example shows how to use the following methods: setJavaScriptCanOpenWindowsAutomatically, setJavaScriptEnabled, setLayoutAlgorithm
         
        appView.setInitialScale(100);
        appView.setVerticalScrollBarEnabled(false);
         
        WebSettings settings = appView.getSettings();
        settings.setJavaScriptEnabled(true);
        settings.setJavaScriptCanOpenWindowsAutomatically(true);
        settings.setLayoutAlgorithm(LayoutAlgorithm.NORMAL);
         
 
    	Package pack = this.getClass().getPackage();
    	String appPackage = pack.getName();
    	 
        WebViewReflect.setStorage(settings, true, "/data/data/" + appPackage + "/app_database/");
         
        /* Bind the appView object to the gap class methods */ 
        bindBrowser(appView);
         
        root.addView(appView);                   
        setContentView(root);                        
Full Snippet Info
9
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: setCacheMode, setDomStorageEnabled, setJavaScriptEnabled, setSaveFormData, setSavePassword
 
  private void initWebView() { 
    mWebView.setWebViewClient(new WebViewClient());
    mWebView.setWebChromeClient(new WebChromeClient());
    WebSettings settings = mWebView.getSettings();
    settings.setSavePassword(true);
    settings.setSaveFormData(true);
    settings.setJavaScriptEnabled(true);
    settings.setSupportZoom(false);
    settings.setCacheMode(WebSettings.LOAD_NO_CACHE);
    settings.setDomStorageEnabled(true);
    settings.setSupportMultipleWindows(false);
 
 
    mWebView.loadUrl("http://developer.android.com");
  } 
 
  @Override 
  public void onBackPressed() { 
    if (mWebView.canGoBack())
Full Snippet Info
8
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
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);
    } 
} 
Full Snippet Info
8
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: setDatabaseEnabled, setDatabasePath
 
    @Override 
    public void applyWebSettings(WebView view) {
        super.applyWebSettings(view);
        WebSettings settings = view.getSettings();
        settings.setDatabaseEnabled(true);
 
        Context context = view.getContext();
        String databasePath = context.getDir("database", Context.MODE_PRIVATE).getPath();
        settings.setDatabasePath(databasePath);
    } 
 
} 
Full Snippet Info
7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
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;
	} 
 
Full Snippet Info
7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE

Related Android WebSettings Questions & Answers:

See Code Examples for Android WebSettings Methods: