androidandroid-networkingringtonemanager

How to check if the Android Tablet has simcard feature programatically?


How can i check Android tablet using Android app ,if it has sim card (4g) feature or not. since i have created an App that has to perform different Task depending on if it has simcard (4g) phone feature or not.


Solution

  • You have to play around with TelephoneyManager to test if it has simcard slot or not . to be exect try below code. more details from 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);
    
        }