I am trying to set a webview's default zoomed in percentage based upon what screen type is being used (ldpi, mdpi, hdpi, xlarge etc). Can I do this in the java code? How can I do it? I know I can set zooming to true which is very useful (wv.getSettings().setBuiltInZoomControls(true);), but how can I set a default scale size. Any help would be great! thanks..
Here is some Pseudo-code to show you what I mean:
if(screenSize == xlarge){
setWebViewZoomScale(400);
}
You could add a value in the "dimen.xml" file, like:
<integer name="WebViewDefaultZoom">10</integer>
Then you can add a dimen file in "values-mdpi", "values-hdpi", "values-xhdpi", ... with the value you want for each resolution...
Then in your code, you will be able to do something like that:
setWebViewZoomScale(getResources().getInteger(R.integer.WebViewHeight));