Android 测试工具类
2010-02-09 03:51:00 来源:WEB开发网super.onPause();
}
/**
* Parse TelephonyManager values into a human readable String.
*
* @param telMgr
* @return
*/
public String getTelephonyOverview(final TelephonyManager telMgr) {
int callState = telMgr.getCallState();
String callStateString = "NA";
switch (callState) {
case TelephonyManager.CALL_STATE_IDLE:
callStateString = "IDLE";
break;
case TelephonyManager.CALL_STATE_OFFHOOK:
callStateString = "OFFHOOK";
break;
case TelephonyManager.CALL_STATE_RINGING:
callStateString = "RINGING";
break;
}
GsmCellLocation cellLocation = (GsmCellLocation) telMgr.getCellLocation();
String cellLocationString = cellLocation.getLac() + " " + cellLocation.getCid();
String deviceId = telMgr.getDeviceId();
String deviceSoftwareVersion = telMgr.getDeviceSoftwareVersion();
String line1Number = telMgr.getLine1Number();
String networkCountryIso = telMgr.getNetworkCountryIso();
String networkOperator = telMgr.getNetworkOperator();
String networkOperatorName = telMgr.getNetworkOperatorName();
int phoneType = telMgr.getPhoneType();
String phoneTypeString = "NA";
switch (phoneType) {
case TelephonyManager.PHONE_TYPE_GSM:
phoneTypeString = "GSM";
break;
case TelephonyManager.PHONE_TYPE_NONE:
phoneTypeString = "NONE";
break;
}
String simCountryIso = telMgr.getSimCountryIso();
String simOperator = telMgr.getSimOperator();
String simOperatorName = telMgr.getSimOperatorName();
String simSerialNumber = telMgr.getSimSerialNumber();
String simSubscriberId = telMgr.getSubscriberId();
更多精彩
赞助商链接