hi
How do i find if the dvice is a phone or a tablet ?
GetPhoneType As String
Returns the phone radio type. Possible values: CDMA, GSM, NONE.
when i test the above it returns GSM for both the cases. however my tablet micromax funbook does not have phone facility !!!. Is there any other way to ascertain the device type?
elitevenkat India
Sub Activity_Create(FirstTime As Boolean)
If GetDevicePhysicalSize > 6 Then
'7'' or 10'' tablet
Else
'phone
End If
End Sub
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
Thanks You Mr.Erel. My problem is as the screen resolution varies from product to product (7" tab and Phone), the layout and the contents thereon is being displayed differently. Do i have to create layouts corresponding to the screen resolution of the device and select the appropriate layout programmatically ? is there any better solution for this?
elitevenkat India
You do not need to do anything special in your code. You should instead create a layout variant for tablets and use the designer script to fine tune your layout.
There are several threads in the forum about this topic.
I'm thinking that trying to determine the device type by size work may not work for phones bigger than 6inches (such as Samsung's upcoming 'Mega' phone that is 6.3 or whatever inches). I know they are rare but its just a thought.
Thats all.