Image loses quality in WebView - android

I'm displaying a 1500x1000 px sized image in an Android WebView, but it displays it in poor quality. I read somewhere that quality can be preserved using and displaying many smaller parts from the original image, but that seems like too much work and not sure how it really could work.
I added
<supports-screens
android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true" />
and created a drawable-hdpi folder and put the image in there, with no change.
Has anyone done this succesfully or any suggestions?

Related

My Android Studio keeps ignoring Large Layout and picks Normal for ALL screens

I'm using the Layout Variants tool to create differents sizes for my layout.
the problem is that when i pick any large Device to preview my layout..
it keeps using the normal size
how can i force it to pick the right layout for the screen ?
by the way i already did the AndroidManifest support screens
<supports-screens
android:anyDensity="true"
android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:xlargeScreens="true" />
but still having problems!
also my app icon looks so small too in my phone!
any idea?

android image size with mdpi ldip hdpi xdpi

I have put 4 image for each folder mdpi,ldpi,hdpi,xdpi in the ratio of 3:4:6:8.
Now I need to make any changes in androidmanifieast.xml file or application automatic select from which folder he need to pick up proper image according to screen resolution of device?
Thank You.
Now I need to make any changes in androidmanifieast.xml
you have to add this code in manifest.xml file
<supports-screens
android:anyDensity="true"
android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:resizeable="true"/>
application automatically pick up proper image according to screen resolution..

How to create android's application supporting multiple screen size

I look over some guide and tutorial but my problem still exists.
I develop this application using small image to create button, text and background and i put it in res/drawable-ldpi directory. Then i see on web that i have to make images with this proportion:
3:4:6. So if my images were small, to create them for medium screen size, i have to take dimension of small image and multiple for 4/3, and for large screen multiple for 6/3=2.
I see these here: Providing Resource.
Now when i create just some images for normal screen ( medium ) i launch emulator with screen density 160 or 200, but the image still remain that used in ldpi.
What can i do?
Can you explain me well what is the problem with these multiple screen and how to solve this?
This is a part of my android manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="spazio.digitale.com" android:versionCode="1"
android:versionName="1.0" android:installLocation="auto"
android:screenOrientation="portrait"
>
<uses-sdk android:minSdkVersion="7" android:maxSdkVersion="11" />
<uses-permission android:name="android.permission.INTERNET" />
<supports-screens android:normalScreens="true"
android:smallScreens="true" android:largeScreens="true"
android:anyDensity="true" />
use to pixels scale to design..
put this in manifest
<supports-screens
android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"
/>
For button, create images using 9-patch tool.
With bitmaps, the rule of thumb is to start with the highest density first, and then scale it down, because it's always easier to scale down bitmaps than to scale them up.
Also, you seem to be confusing screen density with screen size. Do not worry about the screen size for now (unless you have one background image that takes the entire screen size, which I doubt). And no, the ratio you mentioned has nothing to do with screen sizes, that only applies to screen densities. Fix the density issue first and foremost. Then, once that's fixed, you can focus on making sure the layout fits the size.
And don't even bother with ldpi, that's only 0.2% of the market of handsets. You're just wasting your time optimizing for that density.

Scale images according to device

I have developed an Android game using a Canvas. When I port the game on devices with different resolutions, the graphics, such as ImageButtons, get scaled according to resolution, but the background images do not scale appropriately.
I have written these lines in manifest file :
<supports-screens
android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"
/>
Why don't the background images scale correctly?
You can use ImageView.ScaleType
ImageView.ScaleType="CENTER_CROP"
Try to use an ImageView that will most likely scale automatically. At least it did in my program. It's worth a try.

Android Application not fit to screen correctly

I have found a problem in Android Emulator,
when i run application on Emulator on android 2.3.3 WQVGA400 it runs fine,
but screen width size is so small
so i check the Built in Resolution to make width size to 800" something and height t0 600"
Now my problem is when i run application on this, then it shows only in a short portion of Emulator screen, extra space on below is always remain
And one thing is that when I run on Actual device is runs very perfectly
You should probably read this: http://developer.android.com/guide/practices/screens_support.html
Add to your AndroidManifest.xml
<supports-screens
android:smallScreens="true"
android:normalScreens="true"
android:largeScreens="true"
android:xlargeScreens="true"
android:anyDensity="true" />
How do you add the text in the green buttons? Is this button a nine patch image? Is the text separate from the image?
Use nine patch images. Then add the text using Button control, where you put the image as background and the text as caption/title/text so on. And when you run the application on larger screen, the image + text will be resized correctly.
Add next line to your AndroidManifest.xml:
<supports-screens android:resizeable="true" />
More information about this attribute can be found in documentation.

Categories

Resources