Zoom On Web View - android

Hi I have a html document's webView Show me how I can enable zoom in webView??
My Code:
WebView webView = (WebView) findViewById(R.id.webView1);
webView.loadUrl("file:///android_asset/police_gozarname.html");

please try this snippet.
webView.getSettings().setBuiltInZoomControls(true);

Type below line before you load your webview.
webView.getSettings().setBuiltInZoomControls(true);

You can enable built in zoom controls by:
webView.getSettings().setBuiltInZoomControls(true);

Related

Unable to open angular 4 app in a webview

I am trying to open
http://admin.aquateams.com
in android webview but it's showing white screen.
Do I need any polyfill for this ??
Here is webview code for android:
webView.getSettings().setJavaScriptEnabled(true);
webView.getSettings().setLoadWithOverviewMode(true);
webView.getSettings().setUseWideViewPort(true);
webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY);
webView.setScrollbarFadingEnabled(false);
webView.getSettings().setBuiltInZoomControls(true);
webView.loadUrl(String.valueOf("http://admin.aquateams.com")));
var myWebView = page.getViewById("my-web-view");
myWebView.android.getSettings().setJavaScriptEnabled(true);
myWebView.android.getSettings().setAppCacheEnabled(true);
myWebView.android.getSettings().setDomStorageEnabled(true);

Android how to make webView show pop up input dialog

Pop up like this pic
I tried this setting but didn't work
webview.getSettings().setJavaScriptEnabled(true);
webview.getSettings().setLoadWithOverviewMode(true);
webview.getSettings().setUseWideViewPort(true);
webview.setWebViewClient(new WebViewClient());
webview.setWebChromeClient(new WebChromeClient()) ;
Use alert of of Javascript? Because I don't understand what you want.

In Android, why does a webpage display correctly on Google Chrome and not in a WebView?

My webpage works fine on Google Chrome on my Android phone, but it does not display well when I load it inside a WebView.
My WebView settings as follows:
webview.getSettings().setJavaScriptEnabled(true);
webview.getSettings().setDomStorageEnabled(true);
webview.getSettings().setDatabaseEnabled(true);
webview.getSettings().setAppCacheEnabled(true);
webview.getSettings().setUseWideViewPort(true);
webview.getSettings().setLoadWithOverviewMode(true);
webview.getSettings().setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NORMAL);
What could be the problem?
Try this before the settings but after you put in the URL
nameOfWebView.setDrawingCacheEnabled(true);
nameOfWebView.buildDrawingCache();
webview.setLayerType(WebView.LAYER_TYPE_SOFTWARE, null);

Android WebView can't display jquery-fullpage page properly

The page is implemented by jquery-fullpage plugin, like this:
http://alvarotrigo.com/fullPage/#firstPage
In android app, WebView doesn't display it properly. It overlaps all the sub pages in one page without scrollbar.
Any idea?
Version of your browser maybe affect. Check issue on Github.
Remember enable javascript in your WebView:
WebView webView = (WebView) findViewById(R.id.webview);
webView = (WebView) findViewById(R.id.webview);
webView.clearCache(true);
webView.clearHistory();
/* Enabling javascript */
webView.getSettings().setJavaScriptEnabled(true);
webView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);

How to display image in webview android?

I am working on android. I am trying to display the page data in webview. i.e actually i am getting the data from php webservice. The result of that php webservice is
a document with images and text.(If we right click on that page and view page source it is all the html data). But now what I am doing is I am setting the php link to the webview. So now, it is display fine in webview (same as how it is displaying in webpage). But now the document contains some images which are displaying in website but those images are not displaying in webview. What should I do now? Please help me in this regard.
Code:
WebView webview;
WebSettings settings;
link = "http://.............../page.php?test=123&test1=345"
webview = (WebView) findViewById(R.id.webView1);
settings = webview.getSettings();
settings.setJavaScriptEnabled(true);
settings.setDomStorageEnabled(true);
webview.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY);
webview.getSettings().setLoadWithOverviewMode(true);
webview.getSettings().setUseWideViewPort(true);
webview.getSettings().setPluginState(PluginState.ON);
webview.loadUrl(link);
please add this line,
webView.getSettings().setJavaScriptEnabled(true);
webView.getSettings().setPluginState(PluginState.ON);

Categories

Resources