简体   繁体   中英

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. But some of tablet has not support the Sim card so I could not find call-Logs and SMS from that tablet.

So I want to disable the facility from that tablet which has not Sim card. So how can I find that the Selected Tablet has Sim card or not..

First of all get Clear that, Not all Android tablet supports telephony manager . 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. 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 . This lets Market hide your app from any device that doesn't support the hardware features your app requires.

Something like,

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

For more info look at this Android - blog and Here

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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