I am developing an Android game, in which a ball (bitmap) translates( is in motion). So I have provided motion equations for the ball. I have checked my app on Samsung galaxy S2 whose actual density is roundly 252 dpi, and It works fine on that. So my question is that Does these motions of bitmaps in surfaceView, depends on actual density of phone( i.e 252 dpi for S2) or generalized density(i.e 240 dpi).
I am confused whether if I run this app on 235 dpi smartphone, So will it have the same performance of motion as it is on Galaxy S2( with 252 dpi) or it would be little slow ?
Any help will be appreciated.
Let me elaborate it with coding. For example a linear motion of a ball is defined as with this equation x=x+4; Now If I run this app, on Samsung galaxy S2(252dpi, and hdpi), So It will give me a particular speed motion, let say P is the speed of the ball. Now If I run this application on Samsung Galaxy S3(300+ dpi, xhdpi), So the ball speed gonna be slow on this density, meaning less than the speed P.
So I will need the same speed on xhdpi density phone. So will use these conversion formulas ; dx= (x*160)/240; px= (dx*320)/160; Hence the speed will be either exact or little different from P.(This is my confusion). That Whether the speed will be as same as it was on S2.
So my Question at this point is that my app worked on Samsung Galaxy S2 with the speed p, that I desired. As S2 is of 252 dpi, So Should I Include 240(Generalized density or 252 (Actual density) in my this line of coding ? dx= (x*160)/240;
Thanks !