0

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..

Biskoppen
  • 37
  • 5
  • 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 Jan 05 '12 at 21:17
  • [can't you use a strechable nine patch for that ?](http://developer.android.com/guide/developing/tools/draw9patch.html) – Snicolas Jan 05 '12 at 21:12

1 Answers1

0

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

Bill Gary
  • 2,987
  • 2
  • 15
  • 19
  • Bill, you dont understand my problem? What is the purpose of points when you cant use it a common rule set for all phones? If I have to take the different point resolutions into account when coding they might as well not exist and I just work with pixels instead? – Biskoppen Jan 05 '12 at 22:32