Sub Globals
Dim DeviceType As Int
Dim Dim480x320x160 As Int: Dim480x320x160 = 1 ' 4" phones lo-res
Dim Dim800x480x240 As Int: Dim800x480x240 = 2 ' 4" phones
Dim Dim800x480x160 As Int: Dim800x480x160 = 3 ' 7" tablets
Dim Dim1280x800x160 As Int: Dim1280x800x160 = 4 ' 10" tablets
Dim LayoutVal As LayoutValues
End Sub
...
Sub Activity_Create(FirstTime As Boolean)
LayoutVal = GetDeviceLayoutValues
Dim Dens As Float
Dens = Density
If LayoutVal.Width >= 1280 AND Dens = 1 Then
LayoutWidth = 1280
Activity.LoadLayout("1280x800x160")
DeviceType = Dim1280x800x160
Else If LayoutVal.Width > 599 Then
LayoutWidth = 800
If Dens = 1.5 Then
Activity.LoadLayout("800x480x240")
DeviceType = Dim800x480x240
Else
Activity.LoadLayout("800x480x160")
DeviceType = Dim800x480x160
End If
Else
LayoutWidth = 480
Activity.LoadLayout("480x320x160")
DeviceType = Dim480x320x160
End If
End Sub