Kindle Fire Cant Fit My Webpage inside a Webview of specific size

Posted by Madhavan Rangarao on Stack Overflow See other posts from Stack Overflow or by Madhavan Rangarao
Published on 2012-09-16T05:49:31Z Indexed on 2012/10/01 21:38 UTC
Read the original article Hit count: 279

This is baffling to me. Please help, I could not figure it out ...

In my sample html file I have set the meta tag to be

<meta name="viewport" content="target-densitydpi=device-dpi, user-scalable=no">

to fit the webpage inside my webview of custom size say 800x600. In Android, I had to specify "target-densitydpi=device-dpi" and it did the job nicely. I tested my custom web page with nexus 7 tablet and the web page fits inside my web view correctly.

The same code does not work in Kindle Fire. Only a part of my web page is shown and even if I set the 'initial-scale=1.0' did not help.

I tried various settings programmatically but it did not help either.

webview.getSettings().setBuiltInZoomControls(true);
webview.getSettings().setSupportZoom(true); 
webview.getSettings().setLoadWithOverviewMode(true);
webview.setInitialScale(1);
webview.getSettings().setUseWideViewPort(true);

Any pointers?

© Stack Overflow or respective owner

Related posts about android-webview

Related posts about kindle-fire