How to control default zooming of webview on touching textFields - android

I am loading .html file on Android Webview. That htmnl file contains textFields. So as the user taps over textfield our webview is getting zoom in. As a result my webpage getting widened (out of content )
I am using the code as:
WebSettings webSettings = m_webView.getSettings();
webSettings.setJavaScriptEnabled(true);
webSettings.setBuiltInZoomControls(false);
webSettings.setLoadsImagesAutomatically(false);
webSettings.setUseWideViewPort(false);
webSettings.setDefaultZoom(ZoomDensity.FAR);
webSettings.setSupportZoom(false);
Please let me know if anything i am missing.
Thanks in advance

You need to add to your html:
It's also a good idea to add the next settings to your webview.
settings.setUseWideViewPort(true);
settings.setLoadWithOverviewMode(true);
webView.setInitialScale(1);
settings.setJavaScriptEnabled(true);
settings.setSupportZoom(false);

You need to change your code in order to set zooming controls in your app
webSettings.setJavaScriptEnabled(true);
webSettings.setBuiltInZoomControls(true);
webSettings.setLoadsImagesAutomatically(false);
webSettings.setUseWideViewPort(false);
webSettings.setSupportZoom(true);

Try using
webview.getSettings().setDefaultZoom(WebSettings.ZoomDensity.FAR);

Related

on android webview avoid or block unexpected open help center for cookies

i have development a android app with web view but sometimes it opens the help center for cookies:
this is my configuration:
webSettings = webview.getSettings();
webSettings.setJavaScriptEnabled(true);
webSettings.setJavaScriptCanOpenWindowsAutomatically(true);
webSettings.setDomStorageEnabled(true);
webSettings.setAllowFileAccess(true);
webSettings.setAllowContentAccess(true);
webSettings.setCacheMode(WebSettings.LOAD_CACHE_ELSE_NETWORK);
webSettings.setGeolocationEnabled(true);
webSettings.setSaveFormData(true);
how can i prevent this from happening?
Add this line after initialize your webview
CookieManager.getInstance().setAcceptCookie(true);

i Cant Select file in my own browser in android

I have created an android app for a simple website view (Using webview) but I can't select file using
I am trying to make a app which completely load the website made using php
use your Web view in this way .
webview =(WebView) findViewById(R.id.webView);
WebSettings webSettings=webview.getSettings();
webSettings.setJavaScriptEnabled(true);
webSettings.setDomStorageEnabled(true);
webSettings.setJavaScriptCanOpenWindowsAutomatically(true);
webSettings.setDatabaseEnabled(true);
webview.setWebViewClient(new WebViewClient());
webview.loadUrl(url);

Webview blank page quakenet

Before read my post, I try to search, but I didn't resolve my problem.
I use a webview for QuakeNet IRC WebChat
WebView myWebView = (WebView) findViewById(R.id.webView);
WebSettings webSettings = myWebView.getSettings();
webSettings.setJavaScriptEnabled(true);
webSettings.setJavaScriptCanOpenWindowsAutomatically(true);
webSettings.setDomStorageEnabled(true);
myWebView.loadUrl("http://webchat.quakenet.org/");
myWebView.setWebViewClient(new WebViewClient());
I have a blankscreen.
But when I try to load http://www.google.com, that's work.
I have try to enable JS, but it's not this.
Can you help me pls.
Thank you :)
The chat on the website seems to use websockets.
According to this post: WebSocket in Android WebView websockets are not supported natively on android webview.
Check your logcat for errors.
You can try to follow this link and change your code http://foretribe.blogspot.it/2013/08/how-to-make-android-webview-support.html

Jquery datepicker not showing in Android Webview. Works in native browser

I'm trying to embed an HTML page in a webview. The page has some jquery and javascript. When an input field is clicked it brings out the jquery datepicker. It works well in the native browser but, doesn't work in the webview. I did set enableJavascript to true but still not showing. So I'm not sure how it works if opened in the native browser, but not if is in webview. Am I missing anything? Any help is appreciated. This is my code:
myWebView = (WebView) findViewById(R.id.webView);
//Enable Javascript
WebSettings webSettings = myWebView.getSettings();
webSettings.setLoadWithOverviewMode(true);
//Enable DOM Storage
webSettings.setDomStorageEnabled(true);
//Enable Zoom
webSettings.setBuiltInZoomControls(true);
//I was adviced to place some of this to handle page navigation:
myWebView.setWebChromeClient(new WebChromeClient());
myWebView.setWebViewClient(new WebViewClient());
//other settings
myWebView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY);
myWebView.setScrollbarFadingEnabled(false);
//finally, load url
myWebView.loadUrl("https://www.mycustomurl.com");
You have to enable Javascript in your webview...
like this,
WebView.getSettings().setJavaScriptEnabled(true);
in your code, add this too..
webSettings.setJavaScriptEnabled(true);

Android webview ban zoom on multitouch

How i can do that? Id like to ban the zooming of the webview in multitouch.
Please use this code
WebSettings settings = mWebview.getSettings();
settings.setSupportZoom(false);

Categories

Resources