device type

elitevenkat

Active Member
Licensed User
Longtime User
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
 

elitevenkat

Active Member
Licensed User
Longtime User
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
 
Upvote 0

Amalkotey

Active Member
Licensed User
Longtime User
Hi erel,

thank you for the information.

-Amalkotey-
 
Upvote 0

hookshy

Well-Known Member
Licensed User
Longtime User
GetDevicePhysicalSize

Hi,
It seems that I can not use this option: GetDevicePhysicalSize
The code is not recognised.
What library should I use?
Thanks
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
GetDevicePhysicalSize is a routine in the Scale module that you can find here.

You can get the screen size with ApproximateScreenSize.
B4X:
Dim lv As LayoutValues
lv = GetDeviceLayoutValues
ScreenSize = lv.ApproximateScreenSize
Best regards.
 
Upvote 0

bahamasc

Member
Licensed User
Longtime User
What do you mean with "will this work?" ?

There isn't a "correct" answer in this case.

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.
 
Upvote 0

EduardoElias

Well-Known Member
Licensed User
Longtime User
Hi there,

If someone could help....

I am using this GetDevicePhysicalSize and the return value for one tablet that I have here is strange....

I returns size as 7.89 (I suppose Inch) and it is a 10inch tablet!!

GetDeviceLayoutValues returns 1024 x 720 scale = 1 (160dpi)

Eventually the calculation is right, however this tablet is for sure a 10inch.

What is wrong?

Thank you !
 
Upvote 0
Top