The following code uses reflection to extract the exact horizontal and vertical dpi (dots per inch) values:
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
The following code uses reflection to extract the exact horizontal and vertical dpi (dots per inch) values:
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
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.