0
votes

I am really confused of the purpose with DIP on Android when the number of DIPs differs from device to device, even in the same size classed. (like medium displays)

I am developing a game right now where I for an example is displaying a full screen bitmap as a background in the game..

Something like this : drawSprite( bmBackground, 0, 0, 533, 320, canvas );

533x320 is the DIP resolution of my Samsung S2 display.. but on some HTC, which are also on the medium display class, the resolution might be 480x320 and then my background wont fit the screen unless I dynamicly calculates new a DIP size for it

I thought the idea with DIP was that we dont have to make all these considerations about different screens/resolutions all the time.. on iphone both 3 and 4 has the same DIP amount even though the pixel resolutions are the same

I'm confused..

1
iPhone uses a different way than Android to handle different resolutions, all values are in one size(320x480), but for the high resolution, everything is simply scaled to the correct position. This works because the devices have identical aspect ratios where this would not work with android since there are so many different screen sizes and densities.Kekoa

1 Answers

0
votes

dip stands for Density Independent Pixels. That means there are sometimes different from regular pixels. see the link for an explanation.

http://developer.android.com/guide/practices/screens_support.html#screen-independence