}// -- These require READ_PH0NE_STATE uses-permission --// Read the IMEI for GSM or MEID for CDMAString deviceid = telephonyManager.getDeviceId();// Read the software version on the phone (note -- not the SDK version)String softwareVersion = telephonyManager.getDeviceSoftwareVersion();// Get the phone's number (if available)String phoneNumber = telephonyManager.getLine1Number();Note that, except for the phone type, reading each of these properties requires that the read_phone_ STATE uses-permission be included in the application manifest:You can also determine the type of network you’re connected to, along with the name and country of the SIM or connected carrier network. Reading Network DetailsWhen your device is connected to a network, you can use the Telephony Manager to read the Mobile Country Code and Mobile Network Code (MCC+MNC), the country ISO code, the net¬work operator name, and the type of network you’re connected to using the getNetworkOperator, getNetworkCountrylso, getNetworkOperatorName, and getNetworkType methods:// Get connected network country ISO codeString networkCountry = telephonyManager.getNetworkCountryIso();// Get the connected network operator ID (MCC + MNC)String networkOperatorld = telephonyManager.getNetwork0perator();// Get the connected network operator nameString networkName = telephonyManager.getNetwork0peratorName();// Get the type of network you are connected to int networkType = telephonyManager.getNetworkType(); switch (networkType) {case (TelephonyManager.NETW0RK_TYPE_1xRTT)
case (TelephonyManager.NETW0RK_TYPE_CDMA) case (TelephonyManager.NETW0RK_TYPE_EDGE) case (TelephonyManager.NETW0RK_TYPE_EHRPD) case
đang được dịch, vui lòng đợi..
