如何在android设备中检查电话呼叫服务是否启用?

如何在android设备中检查电话呼叫服务是否启用?,android,phone-call,telephonymanager,Android,Phone Call,Telephonymanager,我想知道如何在不同的设备上检查电话呼叫服务是否启用,我有Micromax Funbook(p300)平板电脑(Android 4.0.3),其中没有呼叫服务,我使用下面的代码来检查 TelephonyManager tm = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE); if (tm.getPhoneType() == TelephonyManager.PHONE_TYPE_NONE) { Log.v

我想知道如何在不同的设备上检查电话呼叫服务是否启用,我有Micromax Funbook(p300)平板电脑(Android 4.0.3),其中没有呼叫服务,我使用下面的代码来检查

TelephonyManager tm = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);   
if (tm.getPhoneType() == TelephonyManager.PHONE_TYPE_NONE) {
    Log.v("TAG", "No calling service");
}else{
    Log.v("TAG", "calling service");
}
但这是行不通的。 它总是只提供消息
呼叫服务


有任何帮助吗?

如果平板电脑不支持呼叫服务,google play将不允许在该平板电脑上安装该应用程序。Google Play在内部检查您的设备支持的权限和应用程序请求的权限,如果不匹配,应用程序将显示为与您的设备不兼容。 编辑:
因此,您当然不需要检查该设备是否支持通话…

如果平板电脑不支持通话服务,google play将不允许在该平板电脑上安装该应用程序。Google Play在内部检查您的设备支持的权限和应用程序请求的权限,如果不匹配,应用程序将显示为与您的设备不兼容。 编辑:
因此,当然,您不需要检查该设备是否支持通话…

试试这个,如果该设备没有进行语音通话的功能,那么它一定不是电话

TelephonyManager tm = (TelephonyManager)getSystemService(TELEPHONY_SERVICE);
String ableToMakePhoneCalls = tm.getVoiceMailNumber(); 

//check device for voicemail number (null means no voicemail number).
if(ableToMakePhoneCalls == null)
{ 
     //If the device does not have voicemail, then it must not be a phone. So it can't call. 
}   

试试这个,若设备并没有进行语音通话的设施,那个么它一定不是电话

TelephonyManager tm = (TelephonyManager)getSystemService(TELEPHONY_SERVICE);
String ableToMakePhoneCalls = tm.getVoiceMailNumber(); 

//check device for voicemail number (null means no voicemail number).
if(ableToMakePhoneCalls == null)
{ 
     //If the device does not have voicemail, then it must not be a phone. So it can't call. 
}   

但这不起作用。。。。运行应用程序时,您得到什么输出?它从表中返回1(TelephonyManager.PHONE\u TYPE\u GSM),但这不起作用。。。。运行应用程序时,你得到了什么输出?它从tablet返回1(TelephonyManager.PHONE\u TYPE\u GSM)。我已经在tablet和我的Micromax A57手机中测试了你的代码,在所有情况下都返回null。实际上,如果开发者想,然后,该应用程序可以安装在任何设备上。只需将电话功能设置为非必需,并在运行时处理即可。实际上,如果开发者愿意,则该应用程序可以安装在任何设备上。只需将电话功能设置为非必需,并在运行时处理即可。