获取手机号码信息以及imsi信息,需要的权限为
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
package com.phoneinfotest; import android.app.Activity; import android.os.Bundle; import android.telephony.TelephonyManager; import android.view.View; import android.view.View.OnClickListener; import android.view.ViewGroup.LayoutParams; import android.widget.Button; import android.widget.LinearLayout; import android.widget.TextView; public class MainActivity extends Activity { private TextView textMobile; private TextView textImsi; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); LinearLayout linearLayout = new LinearLayout(this); linearLayout.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT,LayoutParams.WRAP_CONTENT)); linearLayout.setOrientation(LinearLayout.VERTICAL); Button button = new Button(this); button.setText("获取手机信息"); button.setOnClickListener(new OnClickListener(){ @Override public void onClick(View arg0) { TelephonyManager telephonyManager = (TelephonyManager)getSystemService(TELEPHONY_SERVICE); textMobile.setText(telephonyManager.getLine1Number()); textImsi.setText(telephonyManager.getSubscriberId()); } }); LinearLayout mobileLayout = new LinearLayout(this); mobileLayout.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT)); mobileLayout.setOrientation(LinearLayout.HORIZONTAL); TextView labelMobile = new TextView(this); labelMobile.setText("手机号码:"); textMobile = new TextView(this); mobileLayout.addView(labelMobile); mobileLayout.addView(textMobile); /** * IMSI共有15位,其结构如下: * MCC+MNC+MSIN * MCC:Mobile Country Code,移动国家码,MCC的资源由国际电联(ITU)统一分配和管理,唯一识别移动用户所属的国家,共3位,中国为460; * MNC:Mobile Network Code,移动网络码,2~3位,中国移动系统使用00、02、07,中国联通GSM系统使用01、06,中国电信CDMA系统使用03、05,中国铁通系统使用20,一个典型的IMSI号码为460030912121001; */ LinearLayout imsiLayout = new LinearLayout(this); imsiLayout.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT)); imsiLayout.setOrientation(LinearLayout.HORIZONTAL); TextView labelImsi = new TextView(this); labelImsi.setText("imsi:"); textImsi = new TextView(this); imsiLayout.addView(labelImsi); imsiLayout.addView(textImsi); linearLayout.addView(button); linearLayout.addView(mobileLayout); linearLayout.addView(imsiLayout); setContentView(linearLayout); } }
相关推荐
android 获取手机上面的IMSI序列号、IMEI、MAC地址、IP地址、当前时间、当前经纬度、获取网络类型
android平台获取手机IMSI,IMEI ,序列号,和 手机号的方法
Android判断单双卡(5.0以上),获取手机号码;
对应的文档(源代码)如下: http://blog.csdn.net/a_flying_bird/article/details/38309021
Android应用程序,安装在手机后,轻松获取imsi号码,方便开发和测试人员使用。
Android 读取IMSI 和IMEI号支持双卡双待,可以判断双卡双待通过那个卡上网,及读取双卡双待的电话卡的信息
android--获取手机的IMSI码,并判断是中国移动中国联通中国电信
读取android设备上主卡和副卡的imsi。经测试大部分机型都能正常获取到,如小米等国产机
获取android手机硬件信息,如通讯录,手机版本,系统版本,SDK版本,所有安装包,本机号码,设备ID,IMEI,IMSI,GPS 地理位置定位
[android平台][获取手机IMSI、IMEI、序列号及手机号的用法]
主要介绍了android获取手机IMSI码判断手机运营商代码实例,大家参考使用
双卡手机获取IMSI,兼容多款手机芯片 联发科、高通等多款cpu手机 尤其是各种中国神机
基于Android10.0的设备上,获取相应的MAC地址,手机IMEI号,手机号,手机MSISDN号,手机ICCID号,进行可行性验证,特别是MAC地址方面,在Android10.0前后的设备均进行相应的接口验证,保证其可用性。适合正在致力于...
Android 关于设备状态和操作的API。 获取总大小 获取可用大小 获取SD卡的总大小 获取SD卡可用大小 获取总内存大小 获取可用内存大小 获取系统版本 安装客户端 获取FilesDir目录 ...获取当前网络状态信息 ...获取手机IMSI
Android端获取手机IMEI,IMSI, MAC等授信功能的工具类,还包括屏幕宽高,屏幕亮度,网络类型判断等
本软件是Android获取IMSI/IMEI等信息,以及发短信的小工具。 它可同时获取双卡的IMSI/IMEI;发短信时,可以选择卡1或卡2。它还能模拟手机收到短信,显示提醒并且点击可查看。
getAndroidID : 获取设备 AndroidID getMacAddress : 获取设备 MAC 地址 getManufacturer : 获取设备厂商 getModel : 获取设备型号 shutdown : 关机 reboot : 重启 reboot2Recovery : 重启到 recovery reboot2...
获取手机的IMSI码,并判断是中国移动\中国联通\中国电信 TelephonyManager telManager = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE); /** 获取SIM卡的IMSI码 * SIM卡唯一标识:IMSI 国际移动...
本项目抹平了各大Android手机厂商获取OAID(开放匿名标识)的差异性,轻松通过几句代码即可获取不同手机的OAID,可作为移动安全联盟官网提供的SDK闭源方案(miit_mdid_xxx.aar )的替代方案。 引入指引 最新版本: ...