2

I am trying to check if the device has telephony feature or not. But in emulator, it is always returning false. Why is it so? Am I doing something wrong.

Rookie
  • 8,502
  • 16
  • 56
  • 89

2 Answers2

0

You can just wrap your code in try/catch. It works in all cases, even with the last api changes about sms sending.

try{
    // code that use telephony features
}
catch(Exception e){
    // code that doesn't use telephony features
}
quent
  • 1,670
  • 1
  • 19
  • 25
0

You can also connect to an emulator console to simulate an incoming voice call or SMS. For more information, see Telephony Emulation and SMS Emulation.
End of this page: https://developer.android.com/studio/run/emulator-networking
That is normal, your emulator does't call nor it sends sms (note that Telephony includes a lot of features)

IvanF.
  • 373
  • 7
  • 15