title: Android: animated object different speed acrros differen devices
body: <p>I have a problem to get an identical ball speed across different android devices. Its an outbreakgame with a bouncing ball. I have developed the app on my galaxy s7 but when testing it on my s3 the ball and other objects are approx 30% faster, or something ???.</p>
  
  <ul>
  <li>I am using a surfaceview and the framerate is constant that is about 60fps</li>
  <li><p>the ballspeed is set in termns of dp and stored as a xml-resource. (same with ball radius)</p>
  
  <pre><code> &lt;dimen name="ballSpeed"&gt;5dp&lt;/dimen&gt;
   &lt;dimen name="ballRadius"&gt;6.25dp&lt;/dimen&gt;
  </code></pre></li>
  </ul>
  
  <p>I simply retrieve the field stored in the resource-file</p>
  
  <pre><code>float ballSpeed = createGC.getContext().getResources().getDimensionPixelSize(R.dimen.ballSpeed);
  </code></pre>
  
  <p>and then pass ballspeed to the ball-objects constructor </p>
  
  <p>So how could the speed difference be explained? fps is the same an speed and radius are expressed in dpi. But somehow the speed for the Samsung Galaxy s3 faster. I guess it could have to do with the screensize.</p>
  
  <pre><code>s7 inch: 5.1
  s3 inch: 4.8
  </code></pre>
  
  <p>So my questions are:</p>
  
  <p>Could the different screensizes be the explanation to he difference in speed?
  And how could I possibly take this into account?</p>