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