Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
'Activity.LoadLayout("Layout1")
MyPanel.Width=IntToDIP(100)
End Sub
Sub IntToDIP(Integer As Int) As Int
Dim r As Reflector
Dim scale As Float
r.Target = r.GetContext
r.Target = r.RunMethod("getResources")
r.Target = r.RunMethod("getDisplayMetrics"))
scale = r.GetField("density")
Dim DIP As Int
DIP = Integer * scale + 0.5
Return DIP
End Sub