net5x

Context context = getWindow().getContext();       

TelephonyManager telephonemanage = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);             

  try        {    

   Toast.makeText(this, "MIEI码为:"+telephonemanage.getDeviceId(), 1000).show();     

  }   

    catch(Exception e)        {    

   Log.i("error", e.getMessage()); 

      }

而且需要在AndroidManifest.xml 加入权限才行,内容为:

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

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2021-12-10
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-11-25
  • 2021-12-10
  • 2022-12-23
  • 2021-11-17
  • 2022-02-02
  • 2022-12-23
相关资源
相似解决方案