Android基础:获取手机信息
2016-09-28 17:43
387 查看
获取手机的sim信息 、设备编号 、 网络提供商等
结果:
源码:
PhoneInfo
TelephonyManager tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE); // sim String simOperator = tm.getSimOperator();//sim卡提供商编码 String simSerialNumber = tm.getSimSerialNumber();//sim卡序列号 String simOperatorName = tm.getSimOperatorName();//sim提供商名称 String simCountryIso = tm.getSimCountryIso();//sim国家编码 int simState = tm.getSimState();//sim卡状态 String line1Number = tm.getLine1Number();//本机号码(一般获取不到) // Device String deviceId = tm.getDeviceId();//设备编号 String deviceSoftwareVersion = (tm.getDeviceSoftwareVersion() == null)? tm.getDeviceSoftwareVersion() : "未知版本";//系统平台版本 // Network String networkOperator = tm.getNetworkOperator();//网络提供商编号 String networkOperatorName = tm.getNetworkOperatorName();//网络提供商名称 String networkCountryIso = tm.getNetworkCountryIso();//网络提供商国家编码 int networkType = tm.getNetworkType();//网络类型 int phoneType = tm.getPhoneType();//手机类型:PHONE_TYPE_NONE + PHONE_TYPE_GSM + PHONE_TYPE_CDMA + PHONE_TYPE_SIP String location = tm.getCellLocation().toString() == null ? tm.getCellLocation().toString() : "未知地址";//地址(一般获取不到) Log.d("TAG","simOperator="+simOperator +"\n"+"simSerialNumber="+simSerialNumber +"\n"+"simOperatorName="+simOperatorName +"\n"+"simCountryIso="+simCountryIso +"\n"+"simState="+simState +"\n"+"line1Number="+line1Number +"\n"+"deviceId="+deviceId +"\n"+"deviceSoftwareVersion="+deviceSoftwareVersion +"\n"+"networkOperator="+networkOperator +"\n"+"networkOperatorName="+networkOperatorName +"\n"+"networkCountryIso="+networkCountryIso +"\n"+"networkType="+networkType +"\n"+"phoneType="+phoneType +"\n"+"location="+location );
结果:
源码:
PhoneInfo
相关文章推荐
- 【Android基础 005】 Android获取手机和系统版本等信息
- Android基础教程(四)之------获取手机联系人信息
- 【Android】获取手机中已安装apk文件信息(PackageInfo、ResolveInfo)(应用图片、应用名、包名等)
- 【Android】获取手机中已安装apk文件信息(PackageInfo、ResolveInfo)(应用图片、应用名、包名等) 收藏
- 获取Android手机中SD卡存储信息
- Android获取手机和系统版本等信息的代码
- android的一些常用手机信息获取
- 【Android】获取手机中已安装apk文件信息(PackageInfo、ResolveInfo)(应用图片、应用名、包名等
- Android入门学习_Android获取手机信息
- android系统中获取imei号和其他手机信息
- Android 获取手机总内存和可用内存等信息
- 获取Android手机中SD卡存储信息 获取剩余空间
- android 获取手机信息(device ip,os version etc.)
- 【Android】获取手机中已安装apk文件信息(PackageInfo、ResolveInfo)(应用图片、应用名、包名等) 收藏
- 【Android】获取手机中已安装apk文件信息(PackageInfo、ResolveInfo)(应用图片、应用名、包名等)
- 【Android基础】获取手机分辨率、状态栏、标题栏高度
- Android获取手机内联系人信息
- Android开发之系统信息——获取Android手机中SD卡内存信息
- Android开发之系统信息——获取Android手机中SD卡内存信息
- Android获取手机和系统版本等信息的代码