Reputation: 9580
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
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
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:
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:
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