Access Android Webview

I use webview in my Android application to retrieve some web pages from multiple sites. I have some doubts regarding web browsing behavior.

  • Does the weblog save history, cookies, generate autocomplete information? If so, can we stop him from doing this?
  • If Webview stores cookies, it shares cookies with other regular browsers on the phone (the information stored in the cookie for the xyz website when opened by web browsing can be used when a user tries to open the website from another browser by phone)?
+9
android
source share
2 answers

P1. Does WebView history, cookies, generate autocomplete information? If so, can we prevent this?

[Answer] Yes, WebView stores history and cookies and autocomplete.

To stop:

 //Make sure No cookies are created CookieManager.getInstance().setAcceptCookie(false); //Make sure no caching is done myWebView.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE); myWebView.getSettings().setAppCacheEnabled(false); myWebView.clearHistory(); myWebView.clearCache(true); //Make sure no autofill for Forms/ user-name password happens for the app myWebView.clearFormData(); myWebView.getSettings().setSavePassword(false); myWebView.getSettings().setSaveFormData(false); 

P2. If the WebView stores cookies, does it transfer cookies to other regular browsers on the phone (can the information stored in the cookie for the xyz website when opened with "WebView" be used when the user tries to open the website from another browser on the phone)?

Not. Information is not transmitted to other phone browsers.

+19
source share
  • Yes, web browsing can store history, cookies and fill in autocomplete information, but they will only be available locally for your application, and not throughout the country. You can also manage cookies using tips from this other SO answer

  • As mentioned above, nothing saved by web browsing in your application will not be shared with other browsers on the phone.

+3
source share

All Articles