Sub Globals
Dim phone1 As Phone
End Sub
Sub GetDevicePhysicalSize As Float
Dim lv AsLayoutValues
lv = GetDeviceLayoutValues
Return Sqrt(Power(lv.Height / lv.Scale / 160, 2) + Power(lv.Width / lv.Scale / 160, 2))
End Sub
Sub Activity_Create(FirstTime As Boolean)
If GetDevicePhysicalSize > 6 Then
If GetDevicePhysicalSize >= 8 Then
'10" tablet
Log("10inch")
Activity.LoadLayout("TabletUI")
phone1.SetScreenOrientation(0) ' Rotate to Landscape
End If
If GetDevicePhysicalSize < 8Then
'7" tablet
Log("7inch")
Activity.LoadLayout("TabletUI")
phone1.SetScreenOrientation(0) ' Rotate to Landscape
End If
End If
' less than 6" screen (such as a phone)
If GetDevicePhysicalSize <= 6 Then
'phone
Log("phone")
Activity.LoadLayout("PhoneUI")
End If
End Sub