I am tring to draw a square in the center of the screen. I want there to be a slight margin to the left and right of the square so that is is away from the edge, the way I am trying to create it is below. The problem is that it will not display properly on all devices and that when the screen is tilted some of the square is cut off. I think this is because I use rectSide = 1000. does anybody know a better way to do this that will work on any screen size?
int rectside =1000;
canvas.drawRect(width/2 - rectSide/2,
height/2 - rectSide/2,
width/2 + rectSide/2,
height/2 + rectSide/2, paint);