When I draw a rectangle on the Activity having width = activity.width and height = activity.width (which means the rectangle has the same width as height) the resulting rectangle is NOT a perfect rectangle. It looks higher than its width. What am I missing here? A pixel density problem? How can I draw a perfect rectangle?
The exact physical pixels per inch of the screen in the X dimension could be not the same as in the Y dimension. "dip" are units independ.
Try:
B4X:
Sub Activity_Create (FirstTime As Boolean)
Dim r As Reflector
r.Target = r.GetContext
r.Target = r.RunMethod("getResources")
r.Target = r.RunMethod("getDisplayMetrics")
Log(r.GetField("xdpi"))
Log(r.GetField("ydpi"))
End Sub