Back to project page EnterpriseShow.
The source code is released under:
This is free and unencumbered software released into the public domain. Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a co...
If you think the Android project EnterpriseShow listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.ruixinyuan.producttrainingfinal.utils; // w w w. ja v a2 s.c o m import android.content.Context; import android.telephony.TelephonyManager; /* *@user vicentliu *@time 2013-6-25????1:26:32 *@package com.ruixinyuan.producttrainingfinal.utils */ public class SIMCardInfo { /** * TelephonyManager?????????????????????????? ???????????????????????????? ??????????????????? * ?????????????????????????????????????????????? * ??Context.getSystemService(Context.TELEPHONY_SERVICE)?????????????? */ TelephonyManager mTelephonyManager; /** * ?????????? */ private String IMSI; public SIMCardInfo(Context context) { mTelephonyManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE); } /** * @return ?????????????? */ public String getNativePhoneNumber() { String telephoneNum = null; telephoneNum = mTelephonyManager.getLine1Number(); return telephoneNum; } /** * ??????????????</BR> * ??????????<uses-permissionandroid:name="android.permission.READ_PHONE_STATE"/></BR> * @return */ public String getProviderName() { String providerName = null; // ???????ID IMSI = mTelephonyManager.getSubscriberId(); // IMSI????????3??460???????????????2??00 02??????01????????03????? if (IMSI.startsWith("46000") || IMSI.startsWith("46002")) { providerName = "????"; } else if (IMSI.startsWith("46001")) { providerName = "??????"; } else if (IMSI.startsWith("46003")) { providerName = "????"; } return providerName; } }