Suppose I put some points as (x1,y1) = (133,123), (x2,y2) = (149,136), (x3,y3) = (182,136) and so on which makes a shape something like this:


Now I want to change the position of these points as per the screen resolution such that the shape gets resized and gets centered and also such that the shape doesn’t get damaged. Please help me.
You can grab the scale factor from the
DisplayMetricsas shown in the Android – Supporting Multiple Screens documentation:Multiply all you x and y coordinates with
scaleand your points are screen density independent.To fit the image on the screen (or
Viewprobably), you can grab the width and height of your View. Check the width and height of your image and calculate the maximum scale factor.Combine (multiply) both scale factors and your image should fit your View.