I am using this code:
from Designer - Basic4android Wiki ...though it is modified.
I want to make my app compatible with as many devices as possible and I see in the abstract designer there are the following other landscape layouts (my project is landscape) available:
Do I need to add those all to my layout variants in order for my app to work on those devices? If so, how would I fit them into the above code?
B4X:
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)
'''''''''''''''''
'Set Device Type'
'''''''''''''''''
LayoutVal = GetDeviceLayoutValues
Dim Dens As Float
Dens = Density
If LayoutVal.Width >= 1280 AND Dens = 1 Then
DeviceType = Dim1280x800x160
Else If LayoutVal.Width > 599 Then
If Dens = 1.5 Then
DeviceType = Dim800x480x240
Else
DeviceType = Dim800x480x160
End If
Else
DeviceType = Dim480x320x160
End If
End Sub
from Designer - Basic4android Wiki ...though it is modified.
I want to make my app compatible with as many devices as possible and I see in the abstract designer there are the following other landscape layouts (my project is landscape) available:
Nexus One: 800x480x240 1.5 dens
HTC Wildfire: 320x240x120 .75 dens
HTC Sensation / Evo 3D: 960x540x240 1.5 dens
Galaxy Note: 1280x800x320 2 dens
Galaxy Nexus: 1196x720x320 2 dens
Do I need to add those all to my layout variants in order for my app to work on those devices? If so, how would I fit them into the above code?
Last edited: