zoukankan      html  css  js  c++  java
  • 获取手机设备的唯一码(IMIE )的方法

    public class MainActivity extends
      Activity {

     @Override
     protected void onCreate(
       Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
      TextView textView =(TextView) findViewById(R.id.test);
      TelephonyManager tm = (TelephonyManager) this 

           .getSystemService(Context.TELEPHONY_SERVICE);//     

           String str = ""; 

           str += "DeviceId(IMEI) = " + tm.getDeviceId() + "\n";   

           str += "DeviceSoftwareVersion = " + tm.getDeviceSoftwareVersion() + "\n";   

           str += "Line1Number = " + tm.getLine1Number() + "\n";   

           str += "NetworkCountryIso = " + tm.getNetworkCountryIso() + "\n";   

           str += "NetworkOperator = " + tm.getNetworkOperator() + "\n";   

           str += "NetworkOperatorName = " + tm.getNetworkOperatorName() + "\n";   

           str += "NetworkType = " + tm.getNetworkType() + "\n";   

           str += "PhoneType = " + tm.getPhoneType() + "\n";   

           str += "SimCountryIso = " + tm.getSimCountryIso() + "\n";   

           str += "SimOperator = " + tm.getSimOperator() + "\n";   

           str += "SimOperatorName = " + tm.getSimOperatorName() + "\n";   

           str += "SimSerialNumber = " + tm.getSimSerialNumber() + "\n";   

           str += "SimState = " + tm.getSimState() + "\n";   

           str += "SubscriberId(IMSI) = " + tm.getSubscriberId() + "\n";   

           str += "VoiceMailNumber = " + tm.getVoiceMailNumber() + "\n";   

        

           textView.setText(str);
     }

    }

    记得在配置AndroidManifest.xml中添加读取电话的权限:

    <uses-permission  android:name="android.permission.READ_PHONE_STATE"/>

  • 相关阅读:
    AX 2012 Security Framework
    The new concept 'Model' in AX 2012
    How to debug the SSRS report in AX 2012
    Using The 'Report Data Provider' As The Data Source For AX 2012 SSRS Report
    Deploy SSRS Report In AX 2012
    AX 2012 SSRS Report Data Source Type
    《Taurus Database: How to be Fast, Available, and Frugal in the Cloud》阅读笔记
    图分析理论 大纲小结
    一文快速了解Posix IO 缓冲
    #转载备忘# Linux程序调试工具
  • 原文地址:https://www.cnblogs.com/benxiong/p/3047016.html
Copyright © 2011-2022 走看看