Logo on website in webview displays in low quality - android

NOTE: this issue only occurs on certain android devices (note 2, s4), looks like only on samsung devices but cannot confirm this 100%
So I needed to load a mobile website inside a webview, now the logo in the header of the website gets displayed very pixelated, like it was downsized and then upscaled...
I tried everything: transparent png, jpg with correct background, svg, bigger image, perfect size image, smaller image,... Image didn't went over 10kb.
Any idea what could go wrong...
EDIT: included screenshot
On the left the icon showed on HTC One, HTC One X, Nexus 4, Nexus One
Right: Samsung Galaxy S4 and Note 2

Related

Confusion with my layouts - android

I'm currently working on my application, which tries to support different screen resolutions but I noticed a major problem with my layouts. I'll explain:
I have two folders in my res folder. They are called "layout" and "layout-sw360dp" which is meant to support big screens like Samsung Galaxy S4, HTC One, etc.
Now, when I try to run my application on my private phone, galaxy S4, the app looks fine and all of the images and the components are perfect.
But when I try to run my app on an HTC One device, suddenly the layout looks small, like very small. It supposes to fit the entire screen, like in my galaxy s4.
It's like HTC One and Galaxy S4 don't use the same layout folder, although their screens sizes are almost the same.
If you guys can clarify this matter for me I would really appreaciate that.
Edit: I have tried to run my app on an Samsung Galaxy S5 device and it looks find, like the way it should. What is the problem with HTC One?
Physical size is usually measured in inches, it simply tells you the real device's screen size
dpi, is NOT correlated with it. Dpi expresses screen density, how many pixels are shown in a given area (usually a square inch). It could be considered as a measure of screen quality.
Resolution is given by the product of the two; it expresses the total number of physical pixels on a screen.
android:anyDensity="true"
Samsung Galaxy S4, HTC One have different physical size : DIFFERENCE
Refer this for how to choice best resolution : DOC

samsung tab3 returns wrong screen resolution

Working on a Flash Video player project, it would be playable in Android & iOs
The output has come perfectly in win xp & win 7 desktops. The screen and alignment of various objects was perfect in desktop. We checked it in 4:3 & 16:9 monitors, it was perfect.
Check desktop screen shoot
Here Windows Desktop view of the app. The pink colour border streches to fill the boundry of the display area. This is perfect.
But displays wrongly in Samsung Galaxy Tab 3 7.0 SM-T211
Check screen shot taken in Samsung Tab3
But the same app when displayed in Samsung Tab 3, the pink border does not touches the boundary of the screen.

7 and 4.7 inch tab/phone come under normal screen

i have bsnl penta 7" tab. It comes under normal, mdpi, 455x800, screen size is ~5.4"(but tab is 7") when checked via code.
The real problem is, when running my application it loads images, size etc from \res\drawable folder (not a problem with mdpi also not loading from /res/drawable-large). So that the images and font will be small. Similar problem is occurring in some other smart phones too. How can be handled it.
I also configured an emulator similar spec to that tab and it works perfectly.
thanks in advance

Android background shows circle

I'm facing a problem in rendering the layout background image attached here on higher resolution devices.On few devices it shows well but fails on certain devices.
a) Samsung Galaxy grand renders the background with no circles.
b) Samsung Galaxy s II shows circles in plain background image.
I need to show an consistent image on all device versions.I hope 9 patch image will resolve this problem. Let me know your suggestions further to fix these problem.
Thanks in advance.
Your image is absolutely fine. I'm also pretty sure all of these devices display them correctly and in full color (in custom ROMs you can force Android to use 16-bit color mode which can cause color banding but I believe it's not your case).
I think color bandindg you see on certain devices is caused by low quality LCD matrices used in these phones which are not capable to display full gamut of your gradient.
You can find bad LCD screens even in phones believed to be "top devices". In my experience the worst color banding of gradients is on ASUS devices. Transformer TF101 is just so-so, but on Nexus7 even default wallpaper (the one with colorful blurred stuff) looks ugly. In contrary to these devices, Samsung's Nexus10 has a sharp and vivid screen with no banding.
Usually, the more is brightness, the less is contrast, leading to color banding. IIRC Samsung devices have various screen color profile presets, you can try to play with them.

Android Game working differently in different Android Phone

i recently developed a game, for Android 2.3.3, and strangely im finding few weird behaviour in different phones,
for example
An explosion sprite(256x256 pixels) divided into 4x4=16 images, when displayed is being displayed as a 2x2 image in Samsung Galaxy Ace 2.3.3 and Samsung Galaxy Y, 2.3.5 ,
Also, the accelerometer works in a haphazard form in Sony Xperia 2.3.3 and Samsung Galaxy Ace.. either its too slow(and takes touch gestures after 3-4 second gap) and Android OS throws a Alert box saying, the app is not responding, else its too fast.
Strangely, The game works perfectly on a Samsung S2, just like it plays on the VirtualBox..
please help me, b'cos this is my college project, and I wont even be able to put this up in the market if such a queer problem exists!!
Thanks in Advance!!
I think I have the same experience with the graphics problem:
From your code, I'm guessing you may have pre-computed "width_explosion" and "height_explosion" from the image height/width you have seen in an image editor and using the same values on different devices.
The device you have listed have two different DPI values as Android knows: 240, or MDPI (Galaxy S2) and 120, or LDPI (Galaxy Ace and Galaxy Y). Note that Galaxy S2's DPI is exactly twice as Ace's and Y's.
Android makes it handy for app authors by assisting them in manipulating images. When images are read from resources through getDrawable and are ready for rendering on screen Android resizes the images with respect to 160DPI, so that they will have the same length measured with a ruler on screens with different pixel densities. For example, if an image with 128x128 pixels is 2cm long and 2cm wide on Galaxy S2, it should be 2cm long and 2cm wide on a Galaxy Ace. However, to cover the more pixels on a Galaxy S2, it's resized to 192 x 192 pixels when drawing on a Galaxy S2, because its DPI as the Android system knows it is 240, 1.5 times the DPI of an ADP1 (HTC Dream). Similarly, the image will be resized to 96 x 96 on a Galaxy Ace or Galaxy Y.
The source rectangle in canvas.drawImage, unfortunately, refers to the number of pixels in the resized bitmap. That means the same source rectangle used in your code sample covers 4 times as many pixels on a Galaxy Y as it does on a Galaxy S2. I guess you are describing in the question that "the same sprite file looks like it was divided in 2x2 on a low DPI device but it should be divided by 4x4".
The following example illustrates what happens when I'm trying to replicate your question with devices with different DPIs.
I cannot post images, so I have put the images here (it's my blog):
http://edgeofmap.com/blog/2013/05/android-bitmap-over-devices-of-different-dpis/
Not sure what to do about the graphics issue, but for the accelerometer each device acts differently. Use event.sensor.getMaximumRange() in your onSensorChanged() to get the maximum value and base your actions on that or a percentage of that.

Categories

Resources