It is very easy to check if the current phone has a sim card. All you
need to do is get a TelephonyManager and get the sim state.
TelephonyManager tm = (TelephonyManager) this.getSystemService(Context.TELEPHONY_SERVICE); //gets the current TelephonyManager
if (tm.getSimState() != TelephonyManager.SIM_STATE_ABSENT){
//the phone has a sim card
} else {
//no sim card available
}
I recommend using SIM_STATE_UNKNOWN because with your way a lot of tablets seem to think they have a sim card and even report an ID. I have no idea why but just my experience :)
ReplyDelete
ReplyDeletehey nice post
http://www.videocontelecom.com/prepaid-services.php