I want to display an image from an url with an Webview at Android.
With Android phones with Version 1.5 and 1.6 there is no problem. but the same pic and the same code on an AndroidPhone with Version 2.0 and the pic is totaly pixelated.
Like Android is resizing the image first to a smaller one and then resizing it back to "normal" size.
Unfortunately its important to display the pic without any quality loss.
I tried to integrate it in the sourcefolder to show it as an normal image, but at Android 2.0 i get an exception because the image is to big. (At Android 1.6 there is no problem)
Any ideas how i can display the image without quality loss with Android 2.0 ?
Anyway, I believe it's a strange behavior of WebView control. There's a small workaround that is useful in case when you supply the images via your own server. If the image is in PNG format, you can set color depth to 8 bit. Though it will decrease color quality, the image won't be blurred when zoomed in.
Long time this thread is here but here are my two cents :
Doing the same thing it took me two days to figure out what my problem was :
On one of my phone I was using wifi, on the other one I was connected on edge via my carrier.
Turns out most carriers around the world use a proxy that downsize images on the fly to lighten the burden on the network. The downsizing is pretty hard and the quality is very bad.
So that in my case it was not due to the framework version as I thought but by the type of connection I used.
Use
android:resizeable="true"
instead ofandroid:resizable="true"
. There is a missing"e"
.If you have not already done it, add this to your manifest :
Without this, everything will be scaled.
Also, if you dont want your device/emulator to scale your drawables you have to create drawables for each density by putting a higher resolution version into hdpi folder