简体   繁体   English

如何检查平板电脑是否支持SIM卡?

[英]How can I check that whether tablet supports sim card or not.?

I am creating an application which sync the data of call-Logs,SMS,Calendars etc. to the webserver. 我正在创建一个应用程序,用于将呼叫日志,SMS,日历等的数据同步到Web服务器。 But some of tablet has not support the Sim card so I could not find call-Logs and SMS from that tablet. 但是某些平板电脑不支持Sim卡,因此我无法从该平板电脑上找到通话记录和短信。

So I want to disable the facility from that tablet which has not Sim card. 因此,我想从没有Sim卡的平板电脑上禁用该功能。 So how can I find that the Selected Tablet has Sim card or not.. 因此,我如何才能找到所选平板电脑是否具有Sim卡。

First of all get Clear that, Not all Android tablet supports telephony manager . 首先要明白, 并不是所有的Android平板电脑都支持电话管理器 but some do, 但是有的

Actually telephony is an "umbrella feature" , where the tablet may support some sub-features. 实际上,电话是一项“伞功能” ,平板电脑可能会支持某些子功能。

EDIT: 编辑:

  1. Specify a uses-feature node for every API feature used by your app. 为您的应用使用的每个API功能指定一个使用功能节点。 This forces you to think about what your app uses, allowing you to: 这迫使您考虑应用程序的用途,从而使您能够:

  2. Decide which features are necessary for your app to be useful and mark those featured with the attribute required=true . 确定要使您的应用有用的必要功能,并使用属性required = true标记这些功能。 This lets Market hide your app from any device that doesn't support the hardware features your app requires. 这样一来,Market即可在不支持您应用所需硬件功能的任何设备上隐藏您的应用。

Something like, 就像是,

<uses-feature android:name="android.hardware.telephony"
              android:required="true"/>

For more info look at this Android - blog and Here 有关更多信息,请查看此Android-博客此处

TelephonyManager telephonyManager1 = (TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE);
           if(telephonyManager1.getPhoneType()==TelephonyManager.PHONE_TYPE_NONE)
{
  //coming here if Tablet 
}
else{
  //coming here if phone
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM