Kindle Fire HD (7") screen resolution: difference between spec and JS/CSS detected resolution - resolution

I don't know if I'm misunderstanding something fundamental in how screen resolutions work, but I'm getting stuck on an issue with the Kindle Fire HD (7").
I have a responsively designed page that, as normal, uses CSS media queries to change the presentation of certain elements. This works as expected on all browsers and devices tested, except for when browsing with the Kindle Fire HD (7"). According to specs (http://en.wikipedia.org/wiki/Kindle_Fire_HD) it has a screen resolution of 1280 x 800 px. This is also verified when I check the device using WURFL's test tool at tools.scientiamobile.com.
So... I have breakpoint screen widths set for
'mobile' - 767px and below
'tablet' - 768 - 989 px
'desktop' - 990px and above
... so I'd expect the Kindle Fire to display my page in 'tablet' mode in portrait orientation, or 'desktop' mode in landscape. However instead it shows it in unexpectedly smaller breakpoints: 'mobile' mode in portrait, and 'tablet' mode in landscape.
On closer inspection, I'm not sure this is actually much to do with my webpage, or its CSS. When using this device, I also seem to be seeing 'smaller' breakpoint views of other RWD sites (e.g. in portrait mode, I get the 'tiny' breakpoint view of getbootstrap.com, which is aimed at 767px and below).
What's then strange is that, when detecting the screen size using JavaScript, I get 534 x 854px (and have also tested this again on other sites, like supportdetails.com, and got the same results).
I haven't found any similar issues reported re this device, so I'm wondering a) if anyone's encountered similar issues, or b) if I'm just misunderstanding something crucial with how screen resolutions are detected by different devices.
Thanks!

When doing media queries you need to take into account the CSS pixel ratio.
The value you need to use on the media query = (The Advertised number of pixels) / (CSS Pixel Ratio).
This wikipedia page is a good source of CSS pixel ratios to use for this:
http://en.wikipedia.org/wiki/List_of_displays_by_pixel_density
Good Luck

Related

IE10 does not scale background SVG correctly when zoomed (on Surface/Windows 8 phone)

Does anyone know if there is a workaround for this? Internet Explorer 10 and Window phone 8 are not able to correctly scale background SVG images when a user zooms. Looks like IE rasterizes the SVG on load.
Here is an example: The first image is the SVG as a background image. Zoom in on a MS Surface or Windows 8 phone and you'll see it blurs horribly.
The second image is the same SVG as an img tag. Zoom this on a Surface or Windows 8 mobile phone and it scales as you would expect (nice and clean).
Is there any property that can be added to make IE10 behave? Or is it merely a case of waiting for the folks at Redmond to fix it?
The problem is that IE, and other browsers such as Firefox rasterise the SVG before displaying it, so it will become blocky when zoomed.
The easiest way to fix this is to make the SVG file larger than is needed. For example double the size, or more if the user is likely to zoom in further. You can then resize the SVG image with CSS to display it at the correct size. This way the image will be naturally larger, so wont become blocky, unless you zoom in even further. At default zoom level the image is scaled down rather than up, which browsers usually handle better.
Edit: You can find further info on this issue under the “SVG and CSS Backgrounds” heading at http://dbushell.com/2012/03/11/svg-all-fun-and-games/

How to get cross browser images the same color

I've had long standing issues with images being different shades on different browsers - for example on OSX I can make a purple or green box and it will look different on chrome than safari. I have tried exporting as png8, png32, gif, jpg, on and on and nothing changes. I'd love to find some real color safe chart or hex generator or some info as to how I can get around this issue. I've tried using web safe color palettes with same issue. It's really frustrating having a logo look great on one browser and off on another. Also matching CSS to an img will work on one but not the other.
More tests:
The answer about color management led me to a lot to read but doesn't seem to be the issue - both safari 6 and current chrome have color management yet they render images different hues. I made a test of about 10 images exports (gif exact, jpeg, png24, png8, gif adaptive, etc) and did the same in both fireworks and photoshop cs6. The result - both app export different colors (something I suspected as PS exports in sRGB I think and I am not sure about FW as it has no settings) - however most images, regardless of app export. render differently in the browsers. What is of concern is that while chrome's images pretty much matched the css color, none of safari's images (21 of them total!) came even close to the css hex that I used in both a web css test and to define the color in the apps.
I have uploaded the screenshot - the top is safari and bottom chrome - the top left corner is the css only and all the rest are the various exports from both photoshop and fireworks using most export options.
http://www.pictureshoster.com/files/6wp6irm154cre3faop2.png
Maybe this has to do with color management. Some browsers like Firefox or Safari support color management.
You could try to temporarily disable color management in Firefox by going to about:config and setting gfx.color_management.mode to 0.
You can find more information about firefox color management here:
http://www.metalvortex.com/blog/2012/03/16/831.html

Retina Display and it's implementation confuses me

Ok so I have been working with a designer who made the mockup of app in Photoshop. I am not using iPhone statusbar and using custom navigation bar which the designer made of 100px. In that navigation he put an icon of 48 pixels.
Now I have to transform into code and I am using UIWebView for the purpose. The layout he designed, I am going to make it in HTML/CSS that will be loaded in UIWebView.
Now the issue is, the PSD he made for the screen has SIZE of 640 x 960. In Iphone4 it's resolution rather than Physical Size. Base on setting of 640 x 960 pixel Image/PSD, he made the top bar of 100pixels. Now If I follow him that things getting messed up.
What I did that I just made everything half of size to accomodate 320 x 480 sceen size in CSS. I set Navigation Bar to 50px(for 320 x 480) and I put #2x.png image (48 x 48) in it.
Now when I load app in my mobile it appears big as it should which gives me impression that 48 pixels did not appear as 24px Image with High Density.
I am quite confused, If I make 100px navigation bar then everything looks big as I am targetting big size while I have to target high resolution. How do I adjust elements(DIV) and Images in my scenario?
Take a look at these articles on using CSS3 media queries and the viewport tag in order to help manage styles between normal and high definition displays:
Targeting the iPhone 4 Retina Display with CSS3 media queries
iPhone 4 and iOS 4 Safari Detection and Behavior

Why does IE change the color?

I've placed an image on top of a div. I'm trying to blend the image into the div (The div is a solid color). In Google Chrome, it looks great! The colors blend perfectly. In IE 7, however, the colors show a hard line even though they should be the same color! After some examination (a print screen put into paint.net to check the actual RGB values), IE 7 is actually lightning up my image.
The blend has to look seamless. Google Chrome was fine with this thus far. Any ideas why IE 7 wont display the color right?
The two browsers are using different rendering engines. There are minor differences between them in how they render graphics, particularly jpegs.
The differences are minor but unavoidable.
Most of the time it goes unnoticed; it only makes an appearance in cases like yours when you try to position it against an element with a solid background colour that is supposed to be the same.
You may be able to resolve the issue by using a different image format. Try saving the image as a PNG. PNGs tend to be rendered more accurately between the browsers than jpegs, so that might be enough to solve your problem.
If that doesn't solve your problem, you could try using PNGs alpha transparency feature to produce an image with a fade to transparent at the edge, and then overlap the background colour behind it. This will definitely give you a smooth transition, but is a bit more technical, so harder to achieve. It will also give you problems with older versions of IE (IE6 for sure, I think you'll be okay with IE7), as they had some major bugs with PNG transparency. (If this is an issue for you, there are work-arounds for this; google IEPNGFix for more)

More iPhone 4 resolution scaling fun

So I have two images set to fill the screen - one at 320x480 (iPhone 3) and the other at 640x960 (iPhone 4).
img.png (320x480)
img#2x.png (640x960)
In Interface Builder, I have img.png set to fill the view (it shouldn't be filling the iPhone 4 view, though, right?), and when I build and run, it is notably too small.
So, when I do the opposite, setting img#2x.png as the img, a giant blue question mark fills the view. The project still builds and the image fills the screen, but is very pixelated as if it has been rescaled. It shouldn't have been rescaled, though, as it is the higher resolution.
Now using...
img.png (640x960)
img#2x.png (320x480)
I've also tried switching which file takes the #2x suffix, but that has not helped either. With the smaller file taking the #2x suffix, and setting the image view to img.png, it shows up way larger than the view canvas, but way too small when on the phone. With the smaller file still having the #2x suffix, I tried switching the view to the new img#2x.png and once again got the oversized, pixelated question mark in IB and a low res full-screen image when deployed to the phone.
I also made sure that my view size was set to 640x960 in the size inspector. What else should I be doing?
Don't use #2x when specifying the image name. Just use the base name of the image (so in your case, just img). iOS will do the magic behind the scenes to use the 2x version if it's on a retina display and the regular version otherwise (including when you use a xib to lay out your interface).
The displayed dimensions of the image will always be the dimensions of the non-2x image. The retina display just displays 2 pixels for every 1 which is why the scale is 2.0 and you have to double the dimensions of the original image. So your view size in IB should be 320x480.
Edit
If IB is being finicky, especially in Xcode 4, just try deleting the xib and starting over. Sometimes it gets a bit corrupted and doesn't know what to do with itself. I've had to do this on one or two occasions, and it seems that it worked for the OP as well.

Resources