如何检查是否在Android设备具有语音功能 [英] How to check if an Android device has voice capabilities

查看:125
本文介绍了如何检查是否在Android设备具有语音功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有谁知道programmaticaly检查,如果Android设备,手机或平板电脑,具有语音功能的好方法? 通过语音功能,我的意思是能力,以拨打电话。我知道有设备,如在北美的Galaxy Tab,没有这个能力。

Does anyone know a good way of programmaticaly checking if an Android device, phone or tablet, has voice capabilities? By voice capabilities I mean capability to make phone calls. I know there are devices, like Galaxy tab in North America, that don't have this capability.

推荐答案

我还没试过此我自己,但它看起来像的细节你需要将在TelephonyManager:

I haven't tried this myself, but it looks like the details you need would be in the TelephonyManager:

private boolean hasPhoneAbility()
{
   TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
   if(telephonyManager.getPhoneType() == TelephonyManager.PHONE_TYPE_NONE)
       return false;

   return true;
}

这篇关于如何检查是否在Android设备具有语音功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆