[英]How can I check whether the Sim Card is available in an android device?
[英]How can I check that whether tablet supports sim card or not.?
我正在創建一個應用程序,用於將呼叫日志,SMS,日歷等的數據同步到Web服務器。 但是某些平板電腦不支持Sim卡,因此我無法從該平板電腦上找到通話記錄和短信。
因此,我想從沒有Sim卡的平板電腦上禁用該功能。 因此,我如何才能找到所選平板電腦是否具有Sim卡。
首先要明白, 並不是所有的Android平板電腦都支持電話管理器 。 但是有的
實際上,電話是一項“傘功能” ,平板電腦可能會支持某些子功能。
編輯:
為您的應用使用的每個API功能指定一個使用功能節點。 這迫使您考慮應用程序的用途,從而使您能夠:
確定要使您的應用有用的必要功能,並使用屬性required = true標記這些功能。 這樣一來,Market即可在不支持您應用所需硬件功能的任何設備上隱藏您的應用。
就像是,
<uses-feature android:name="android.hardware.telephony"
android:required="true"/>
有關更多信息,請查看此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.