Today, I am discussing how to use a mobile phone to work in the Organization. I suddenly think of the serial number of the mobile phone card. As long as the serial number of the mobile phone card is used, I can uniquely identify a mobile phone card, when you log on to the system, do not log on. You only need to use the serial number, and it will not be mixed with other network mobile phones. When you come back at night, you will write it all at once, an error was reported at the beginning. Later I remembered that it was caused by permission settings. DetailsCodeHow:
Context context = getwindow (). getcontext ();
Telephonymanager telephonemanage = (telephonymanager) Context. getsystemservice (context. telephony_service );
Try {
Toast. maketext (this, "miei Code:" + telephonemanage. getdeviceid (), 1000). Show ();
}
Catch (exception e ){
Log. I ("error", E. getmessage ());
}
In addition, the permission must be added to androidmanifest. xml. The content is:
<Uses-Permission Android: Name = "android. Permission. read_phone_state"> </uses-Permission>