I have tried the following to fit the webpage based on the device screen size.
mWebview.setInitialScale(30);
and then set the metadata viewport
<meta name="viewport" content="width=320, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; minimum-scale=1.0; user-scalable=0;"/>
<meta name="viewport" content="width=device-width, target-densityDpi=medium-dpi"/>
But nothing works, webpage is not fixed to the device screen size.
Can anyone tell me how to get this?
You can use this
WebView browser = (WebView) findViewById(R.id.webview);
browser.getSettings().setLoadWithOverviewMode(true);
browser.getSettings().setUseWideViewPort(true);
this fixes size based on screen size.