Package Com.yqy.yqy_listviewheadview;import Android.content.context;import Android.telephony.TelephonyManager; Import android.util.log;/** * Get phone info tool <br> * The print function is already encapsulated inside, only need to change the debug parameter to True to <br> * Assuming the need to change the tag can be changed directly, Kezhuang * * * @author YQY * */public class Deviceutils {/** * Get the IMEI number of the application */public static String Getimei (Contex T context) {if (context = = null) {LOG.E ("YQY", "Getimei context is empty");} Telephonymanager Telecommanager = (telephonymanager) context.getsystemservice (Context.telephony_service); String IMEI = Telecommanager.getdeviceid (); LOG.E ("YQY", "IMEI ID:" + IMEI); return IMEI; /** * Gets the system version number of the device */public static int getdevicesdk () {int SDK = Android.os.Build.VERSION.SDK_INT; LOG.E ("YQY", "Device Version number:" + SDK); return SDK;} /** * Gets the model of the device */public static string Getdevicename () {string model = Android.os.Build.MODEL; LOG.E ("YQY", "Device Model:" + model); return model;}}
Android Get phone Info tool class