I need help checking whether a device has a sim card programatically. Please provide sample code.
I need help checking whether a device has a sim card programatically. Please provide sample code.
Thanks @Arun kumar answer, kotlin version as below
fun isSIMInserted(context: Context): Boolean {
return TelephonyManager.SIM_STATE_ABSENT != (context.getSystemService(Context.TELEPHONY_SERVICE) as TelephonyManager).simState
}