Code example for TelephonyManager

Methods: getDeviceId, getDeviceSoftwareVersion, getLine1Number, getSubscriberId

0
         
      //---------------------------------------------- PHONE INFO ----------------------------------------------------------// 
 
        //access phone information 
        // Requires READ_PHONE_STATE (require user permissions) 
        imei = mTelephonyMgr.getDeviceId(); 
        imei_sv = mTelephonyMgr.getDeviceSoftwareVersion();
        phoneNumber = mTelephonyMgr.getLine1Number();
        imsi = mTelephonyMgr.getSubscriberId();
         
      //---------------------------------------------- WIFI MAC ADDRESS ----------------------------------------------------------// 
        //WIFI MAC Address 
        WifiManager wifiMan = (WifiManager)getSystemService(WIFI_SERVICE);
        wifi_info = wifiMan.getConnectionInfo();
         
      //---------------------------------------------- BLUETOOTH ADDRESS ----------------------------------------------------------// 
        //Bluetooth Address 
        mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
         
        // Device supports Bluetooth. if returns null means device DOES NOT SUPPORT bluetooth. 
        if (mBluetoothAdapter != null) {