如何使用Android应用程序检查Android平板电脑,它是否具有SIM卡(4g)功能。因为我已经创建了一个应用程序,它必须执行不同的任务,这取决于它是否具有simcard (4g)电话功能。
发布于 2020-05-06 20:11:10
您必须尝试使用TelephoneyManager来测试它是否有simcard插槽。要执行,请尝试下面的代码。来自here的更多详细信息
public static boolean isSimSupport(Context context)
{
TelephonyManager tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE); //gets the current TelephonyManager
return !(tm.getSimState() == TelephonyManager.SIM_STATE_ABSENT);
}https://stackoverflow.com/questions/61633679
复制相似问题