WEB开发网
开发学院手机开发Android 开发 Android 测试工具类 阅读

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 TelephonyMa

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();

Tags:Android工具

编辑录入:coldstar [复制链接] [打 印]
赞助商链接