1.获取手机SIM卡信息
//获得服务
tm.(TelephoneyManager)getSystemService(Context.TELEPHONY_SERVICE);
//获得设备的编号
String
deviceId=tm.getDeviceId();
//获得SIM的国别
String
Country=tm.getSimCountryIso();
//获得SIM卡的序列号
String
SIMSerial=tm.getSerialNumber();
//获得SIM卡的状态
String
SIMState=simState[tm.getSimState()];
//获得网络运行商的名称
String
networkOperatorName=tm.getNetworkOperatorName();
//获得手机的制式
String
phoneType=phoneTypes[tm.getPhoneType()];
//获得对象
imm=(InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
//第一次调用显示,再次调用则隐藏,如何反复
imm.toggleSoftInput(0,InputMethodManager.HIDE_NOT_ALWAYS);
//获得对象
uiModeManager=(UiModeManager)getSystemService(Context.UI_MODE_SERVICE);
//行车模式
uiModeManager.enableCarMode(UiModeManager.ENABLE_CAR_MODE_GO_CAR_HOME);
//夜间模式
uiModeManager.setNightMode(UiModeManager.MODE_NIGHT_YES);
audioManager=(AudioManager)getSystemService(Context.AUDIO_SERVICE);
//得到当前的通话声音
int
currentCall=audioManager.getStreamVolume(AudioManager.STREAM_VOICE_CALL);
//得到当前的系统音量
int
currentSystem=audioManager.getStreamVolume(AudioManager.STREAM_MUSIC):
//得到当前的提示音声音音量
int
currentTip=audioManager.getStreamVolum(AudioManager.STREAM_ALARM);
//增加系统音量、参数1.声音类型,参数2.调整音量的方向,参数3.可选的标志位
audioManager.adjustStramVolum(AudioManager.STREAM_SYSTEM,AudioManager.ADJUST_RAISE,AudioManager.Fx_FOCUS_NAVIGATION_UP);
//得到电池的电压
int
voltage=intent.getIntExtra("voltage",0);
//得到电池的温度
int
temperature=intent.getIntExtra("temperature",0);
//得到电池的类型
String
texhnology=intent.getStringExtra("technology");
//创建
intent shortcut=new
Intent(CREATE_SHORTCUT_ACTION);
//得到包名
Intent shortcutIntent
=cx.getPackageManager().getLaunchIntentForPackag e(cx.getPackageName());
//设置快捷方式的单击指向
shortcut.putExtra(Intent.EXTRA_SHORTCUT_INTENT,shotcutIntent);
2.获得系统软键盘
3.开启行车模式,夜光模式
4.音量控制器
5.手机电池补充
6.桌面空间方式