8

I am trying to make one of those tiny android apps that do nothing but display a website in a webview object rather than the browse and so far it loads the target webpage but the text and image sizes are all much larger than when the page is viewed in the actual device browser. In the browser the page looks right but not in my app.

Inspecting the page in my desktop chrome reveals the css is using font-size 6em if that helps you.

When I include a viewport meta tag it does not do anything for my app but causes the browser to render the page much closer to the way the webview object does: stuff looks too big.

Is there a quick fix ( eg a viewport tag setting or an api call on the webview object or the websettings object) or do I need to redesign the css, maybe to not use "em"s? BTW, I didn't write the web pages or the css.

Thanks.

PS: BTW, the page I am trying to hit is here: deltabingo.com/delta-bingo-mobile

The Newbie Qs
  • 483
  • 8
  • 22

1 Answers1

1

The difference between the browser and your app is probably because you haven't set the setUseWideViewPort WebSetting to true.

If the page looks too big/too small then it's possible that the viewport isn't want you want it to be, try something like this (and maybe play around with the value width is set to):

<meta name="viewport" content="width=320, initial-scale=1">

It's also worth noting that the page is using target-densityDpi in the viewport, which is not supported by the KK webview.

See here for more info on viewport: https://developers.google.com/chrome/mobile/docs/webview/pixelperfect http://developer.android.com/guide/webapps/targeting.html

marcin.kosiba
  • 3,221
  • 14
  • 19
  • 1
    Thanks, I had that wideviewport setting set but after trying some new viewport settings I am now using this tag and it seems to look about right on my android 4.2 and 4.3 devices. On my 4.04 device (Galaxy Discover I think) it still looks way too big. Looks to big in all the emulators too so far. I know the pages have to be redesigned anyway so maybe I should just make do with this for now. There will be time to worry about 4.4 later. – The Newbie Qs Feb 20 '14 at 20:36
  • Doesn't do anything here. The font renders larger for me no matter what. – HelloWorld Sep 27 '16 at 13:18