V.J.
V.J.

Reputation: 9580

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..

Upvotes: 1

Views: 5068

Answers (2)

Harsh Trivedi
Harsh Trivedi

Reputation: 1010

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

Upvotes: 1

user370305
user370305

Reputation: 109237

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

Upvotes: 7

Related Questions