Code example for WebSettings

Methods: setAllowUniversalAccessFromFileURLs, setBuiltInZoomControls, setDatabaseEnabled, setDatabasePath, setDefaultZoom, setDomStorageEnabled, setJavaScriptEnabled, setLoadWithOverviewMode, setSupportZoom, setUseWideViewPort

0
            getActionBar().setHomeButtonEnabled(true);
        super.onCreate(savedInstanceState);
 
        view = new WebView(this);
        WebSettings settings = view.getSettings();
        settings.setDefaultZoom(WebSettings.ZoomDensity.FAR);
        settings.setBuiltInZoomControls(false);
        settings.setSupportZoom(false);
        settings.setLoadWithOverviewMode(false);
        settings.setUseWideViewPort(false);
        settings.setJavaScriptEnabled(true);
        settings.setDomStorageEnabled(true);
        settings.setDatabaseEnabled(true);
        settings.setDatabasePath("/data/data/" + getPackageName() + "/databases/");
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN)
            settings.setAllowUniversalAccessFromFileURLs(true);
        view.setWebChromeClient(new WebChromeClient() { @Override public void onProgressChanged(WebView view, int progress) { setProgress(progress * 1000); }});
        view.addJavascriptInterface(javaInterface, "java");
        view.loadUrl("file:///android_asset/index.html");
        setContentView(view);
    }