How to detect if device is capable of calling and messaging

后端 未结 6 1378
滥情空心
滥情空心 2020-12-20 12:03

Some devices ie. Galaxy Tablet 10.1 can only send SMS, but cannot call. Some other devices like Asus Transformer don\'t even have SIM card.

How can I detect if devic

6条回答
  •  春和景丽
    2020-12-20 12:55

    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
    }
    

提交回复
热议问题