Android获取系统相应信息代码

String phoneInfo = "Product: " + android.os.Build.PRODUCT; 

        phoneInfo += ", CPU_ABI: " + android.os.Build.CPU_ABI;      

        phoneInfo += ", TAGS: " + android.os.Build.TAGS;      

        phoneInfo += ", VERSION_CODES.BASE: " + android.os.Build.VERSION_CODES.BASE;        

        phoneInfo += ", MODEL: " + android.os.Build.MODEL;      //手机型号 

        phoneInfo += ", SDK: " + android.os.Build.VERSION.SDK;     //sdk版本号

        phoneInfo += ", VERSION.RELEASE: " + android.os.Build.VERSION.RELEASE;    

        phoneInfo += ", DEVICE: " + android.os.Build.DEVICE;       

        phoneInfo += ", DISPLAY: " + android.os.Build.DISPLAY;   

        phoneInfo += ", BRAND: " + android.os.Build.BRAND;      

        phoneInfo += ", BOARD: " + android.os.Build.BOARD;      

        phoneInfo += ", FINGERPRINT: " + android.os.Build.FINGERPRINT;      

        phoneInfo += ", ID: " + android.os.Build.ID;      

        phoneInfo += ", MANUFACTURER: " + android.os.Build.MANUFACTURER;     

        phoneInfo += ", USER: " + android.os.Build.USER;


 private void getInfo() {  
2             TelephonyManager mTm = (TelephonyManager)        getSystemService(TELEPHONY_SERVICE);  
3             String imei = mTm.getDeviceId();  
4             String imsi = mTm.getSubscriberId();  
5             String mtype = android.os.Build.MODEL; // 手机型号  
6             String numer = mTm.getLine1Number(); // 手机号码,有的可得,有的不可得  
7         }  


获取手机MAC地址:

private String getMacAddress(){  
2             String result = "";  
3             WifiManager wifiManager = (WifiManager) getSystemService(Context.WIFI_SERVICE);  
4             WifiInfo wifiInfo = wifiManager.getConnectionInfo();  
5             result = wifiInfo.getMacAddress();  
6             Log.i(TAG, "macAdd:" + result);  
7             return result;  
8     }  

你可能感兴趣的:(Android获取系统相应信息代码)