D
Deleted member 103
Guest
Hi,
With this code, you can determine whether the device is a smartphone or tablet.
I have tablet with a resolution of 800x480, but is not recognized as a tablet, Why?
With this code, you can determine whether the device is a smartphone or tablet.
I have tablet with a resolution of 800x480, but is not recognized as a tablet, Why?
B4X:
Sub GetDevicePhysicalSize As Float
Dim lv As LayoutValues
lv = GetDeviceLayoutValues
Return Sqrt(Power(lv.Height / lv.Scale / 160, 2) + Power(lv.Width / lv.Scale / 160, 2))
End Sub
Sub IsTablet As Boolean
If GetDevicePhysicalSize > 6 Then
'7'' or 10'' tablet
Return True
Else
'phone
Return False
End If
End Sub