views:

26

answers:

2

The problem:

I want to use a WebView to enable dynamic loading of ads in my app. I'm currently running on a HDPI device, and images width a width of 480px are clipped/scrolled. If I use images with a size of 320px, they are zoomed in and rendered at too low a resolution.

The content of the loaded WebView url is a simple web page with just an image tag wrapped in a link, as well a simple head. I've tried playing with the viewport meta-tag, but without any luck.

Any suggestions?

A: 

I had the same issue with a subway map image (1000px, also tried 3000 px width before) in a webview: when zooming, the image gets totally blurry, even though the original graphic is very sharp and uncompressed. The only way I found is to split the images into multiple slices and put them back together via html table. This way, the sharpness remains when zooming. Not sure, which device you're on, but there are i.e. some display issues in general with the Nexus One for example: http://www.displaymate.com/Nexus_One_ShootOut.htm

Mathias Lin
btw: the same issue not only happens with the webview of the SDK, I also experienced it in the regular Android web browser.
Mathias Lin
A: 

Ok, I seem to have worked it out. It's all explained here: http://developer.android.com/reference/android/webkit/WebView.html, under the heading Building web pages to support different screen densities. Not sure if this section was there when I asked the question, but since my question has had a few views and no solution, I thought I'd post it here.

Gunnar Lium