【问题标题】:How to check if the Android Tablet has simcard feature programatically?如何以编程方式检查 Android 平板电脑是否具有 sim 卡功能?
【发布时间】:2020-05-06 11:10:19
【问题描述】:

我如何使用 Android 应用程序检查 Android 平板电脑,它是否具有 sim 卡 (4g) 功能。因为我创建了一个必须执行不同任务的应用程序,具体取决于它是否具有 simcard (4g) 电话功能。

【问题讨论】:

    标签: android android-networking ringtonemanager


    【解决方案1】:

    您必须使用 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);
    
        }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-05-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-05-28
      相关资源
      最近更新 更多