Progmatically check if device is a Phone or tablet

RFI Bill

Member
Licensed User
Longtime User
Hey there!

Was wanting to know if there is a way to check whether the current device is a Phone or Tablet, more precisely - if the device has the ability to send/Receive SMS.

Im writing an app for tablet and i would idealistically like to not have to create a whole new app just for a phone device.

Cheers!
 

Smee

Well-Known Member
Licensed User
Longtime User
what about checking the screen size? is this possible?
 
Upvote 0

merlin2049er

Well-Known Member
Licensed User
Longtime User
Hey there!

Was wanting to know if there is a way to check whether the current device is a Phone or Tablet, more precisely - if the device has the ability to send/Receive SMS.

Im writing an app for tablet and i would idealistically like to not have to create a whole new app just for a phone device.

Cheers!

How about just checking to see if the device has a SIM card?
 
Upvote 0

merlin2049er

Well-Known Member
Licensed User
Longtime User
Is there anything equivalent to a telephony manager?

B4X:
https://sites.google.com/site/androidhowto/how-to-1/check-if-sim-card-exists-in-the-phone
 
Upvote 0

keirS

Well-Known Member
Licensed User
Longtime User
Is there anything equivalent to a telephony manager?

B4X:
https://sites.google.com/site/androidhowto/how-to-1/check-if-sim-card-exists-in-the-phone

B4X:
Dim r As Reflector
r.Target = r.GetContext
r.Target = r.runMethod2("getSystemService","phone","java.lang.String")
Log(r.RunMethod("getSimState"))

This will tell you if there is a SIM in the device. That doesn't tell you if its a phone or a tablet though as a phone may be CDMA only and a tablet may have a sim card for 3G/4G data.
 
Upvote 0
Top