WebSettings setDatabasePath - 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 setDatabasePath method.

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);
    } 
 
} 
7
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:setAllowFileAccess, setAppCacheEnabled, setAppCacheMaxSize, setAppCachePath, setCacheMode
7
CodeRank
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
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:setBuiltInZoomControls, setDatabaseEnabled, setDatabasePath, setDomStorageEnabled, setGeolocationEnabled
import android.webkit.WebView; 
 
public class TxlWebUtil { 
	public static void settingWebView(WebView wv,Activity ctx){
		WebSettings settings = wv.getSettings();
        settings.setJavaScriptEnabled(true);
        settings.setJavaScriptCanOpenWindowsAutomatically(true);
        settings.setLayoutAlgorithm(LayoutAlgorithm.NORMAL);
        // Set the nav dump for HTC 
        //settings.setNavDump(true); 
        // Enable database 
        settings.setDatabaseEnabled(true);
        String databasePath = ctx.getDir("database", Context.MODE_PRIVATE).getPath();
        settings.setDatabasePath(databasePath);
        // Enable DOM storage 
        settings.setDomStorageEnabled(true);
        // Enable built-in geolocation 
        settings.setGeolocationEnabled(true);
        settings.setBuiltInZoomControls(true);
	} 

6
CodeRank
This code example shows how to use the following methods:setBuiltInZoomControls, setDatabaseEnabled, setDatabasePath, setDomStorageEnabled, setGeolocationEnabled
        wv.setWebChromeClient(new LibWebChromeClient());
        wv.loadUrl("http://192.168.92.61:8080/android-lib/assets/www/load_from_remote.html");
    } 
    public void settingWebView(WebView wv,Activity ctx){
        WebSettings settings = wv.getSettings();
        settings.setJavaScriptEnabled(true);
        settings.setJavaScriptCanOpenWindowsAutomatically(true);
        settings.setLayoutAlgorithm(LayoutAlgorithm.NORMAL);
        // Set the nav dump for HTC 
        settings.setNavDump(true);
        // Enable database 
        settings.setDatabaseEnabled(true);
        String databasePath = ctx.getDir("database", Context.MODE_PRIVATE).getPath();
        settings.setDatabasePath(databasePath);
        // Enable DOM storage 
        settings.setDomStorageEnabled(true);
        // Enable built-in geolocation 
        settings.setGeolocationEnabled(true);
        settings.setBuiltInZoomControls(true);
    } 

5
CodeRank
This code example shows how to use the following methods:setAllowUniversalAccessFromFileURLs, setBuiltInZoomControls, setDatabaseEnabled, setDatabasePath, setDefaultZoom
This code example shows how to use the following methods:setAppCacheEnabled, setAppCachePath, setDatabaseEnabled, setDatabasePath, setDomStorageEnabled
4
CodeRank

Related WebSettings setDatabasePath Questions & Answers:

setDatabasePath Method Overview
This method was deprecated in API level 19. Database paths are managed by the implementation and calling this method will have no effect.
See Code Examples for other Android WebSettings Methods: