package com.water.activity;
import java.util.List;
import android.app.Activity;
import android.os.Bundle;
import android.telephony.CellLocation;
import android.telephony.NeighboringCellInfo;
import android.telephony.TelephonyManager;
import android.util.Log;
public class MyList extends Activity {
private TelephonyManager telMgr;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
telMgr = (TelephonyManager) getSystemService(TELEPHONY_SERVICE);
if (telMgr.getSimState() == telMgr.SIM_STATE_READY) {
Log.i("MyList", "良好");
} else if (telMgr.getSimState() == telMgr.SIM_STATE_ABSENT) {
Log.i("MyList", "无SIM卡");
} else {
Log.i("MyList", "SIM卡被锁定或未知的状态");
}
Log.i("MyList", "电话状态[0 无活动/1 响铃/2 摘机]:" + getCallState());
Log.i("MyList", "电话方位:" + getCellLocation());
Log.i("MyList", "唯一的设备ID:" + getDeviceId());
Log.i("MyList", "设备的软件版本号:" + getDeviceSoftwareVersion());
Log.i("MyList", "手机号:" + getLine1Number());
Log.i("MyList", "附近的电话的信息:" + getNeighboringCellInfo());
Log.i("MyList", "获取ISO标准的国家码,即国际长途区号:" + getNetworkCountryIso());
Log.i("MyList", "MCC+MNC:" + getNetworkOperator());
Log.i("MyList", "(当前已注册的用户)的名字:" + getNetworkOperatorName());
Log.i("MyList", "当前使用的网络类型:" + getNetworkType());
Log.i("MyList", "手机类型:" + getPhoneType());
Log.i("MyList", "SIM卡的国家码:" + getSimCountryIso());
Log.i("MyList", "获取SIM卡提供的移动国家码和移动网络码.5或6位的十进制数字:" + getSimOperator());
Log.i("MyList", "服务商名称:" + getSimOperatorName());
Log.i("MyList", "SIM卡的序列号:" + getSimSerialNumber());
Log.i("MyList", "SIM的状态信息:" + getSimState());
Log.i("MyList", "唯一的用户ID:" + getSubscriberId());
Log.i("MyList", "取得和语音邮件相关的标签,即为识别符:" + getVoiceMailAlphaTag());
Log.i("MyList", "获取语音邮件号码:" + getVoiceMailNumber());
Log.i("MyList", "ICC卡是否存在:" + hasIccCard());
Log.i("MyList", "是否漫游:" + isNetworkRoaming());
Log.i("MyList", "获取数据活动状态:" + getDataActivity());
Log.i("MyList", "获取数据连接状态:" + getDataState());
}
private int getCallState() {
return telMgr.getCallState();
}
private CellLocation getCellLocation() {
CellLocation location = telMgr.getCellLocation();
return location;
}
private String getDeviceId() {
return telMgr.getDeviceId();
}
private String getDeviceSoftwareVersion() {
return telMgr.getDeviceSoftwareVersion();
}
private String getLine1Number() {
return telMgr.getLine1Number();
}
private List<NeighboringCellInfo> getNeighboringCellInfo() {
return telMgr.getNeighboringCellInfo();
}
private String getNetworkCountryIso() {
return telMgr.getNetworkCountryIso();
}
private String getNetworkOperator() {
return telMgr.getNetworkOperator();
}
private String getNetworkOperatorName() {
return telMgr.getNetworkOperatorName();
}
private int getNetworkType() {
return telMgr.getNetworkType();
}
private int getPhoneType() {
return telMgr.getPhoneType();
}
private String getSimCountryIso() {
return telMgr.getSimCountryIso();
}
private String getSimOperator() {
return telMgr.getSimOperator();
}
private String getSimOperatorName() {
return telMgr.getSimOperatorName();
}
private String getSimSerialNumber() {
return telMgr.getSimSerialNumber();
}
private int getSimState() {
return telMgr.getSimState();
}
private String getSubscriberId() {
return telMgr.getSubscriberId();
}
private String getVoiceMailAlphaTag() {
return telMgr.getVoiceMailAlphaTag();
}
private String getVoiceMailNumber() {
return telMgr.getVoiceMailNumber();
}
private boolean hasIccCard() {
return telMgr.hasIccCard();
}
private boolean isNetworkRoaming() {
return telMgr.isNetworkRoaming();
}
private int getDataActivity() {
return telMgr.getDataActivity();
}
private int getDataState() {
return telMgr.getDataState();
}
}