I am making multitouch based android app. In the app I am finding distance between two touch coordinates.The Distance between two touch coordinates are same on different devices, but devices show different distance.
Devices A shows 89.0123.
Device B shows 110.84940.
How to get same distance on different devices?
public boolean onTouchEvent(MotionEvent event)
{
int maskedAction=event.getActionMasked();
switch(maskedAction)
/// some code
///case MotionEvent.ACTION_POINTER_DOWN;
///
PointF init_p1,init_p2;
init_p1.x=event.getX(0);
init_p1.y=event.getY(0);
init_p2.x=event.getX(1);
init_p2.y=event.getY(1);
/////// some code
float X_diff=init_p1.x-init_p2.x;
float Y_diff=init_p1.y-init_p2.y;
double xdiffsq= Math.pow(X_diff,2);
double ydiffsq= Math.pow(Y_diff,2);
distance=Math.sqrt(xdiffsq+ydiffsq);
Log.d(TAG,String.valueOf(distance));
///some code
}