Android Get Network Type获得网络类型
16lz
2021-01-23
TelephonyManager teleMan = (TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE);int networkType = teleMan.getNetworkType();switch (networkType){ case 0: textV1.setText("Unknown"); break;case 1: textV1.setText("GPRS"); break;case 2: textV1.setText("EDGE"); break;case 3: textV1.setText("UMTS"); break;case 4: textV1.setText("CDMA"); break;case 5: textV1.setText("EVDO rev. 0"); break;case 6: textV1.setText("EVDO rev. A"); break; case 7: textV1.setText("1xRTT"); break;case 8: textV1.setText("HSDPA"); break;case 9: textV1.setText("HSUPA"); break;case 10: textV1.setText("HSPA"); break;case 11: textV1.setText("iDen"); break;case 12: textV1.setText("EVDO rev. B"); break; case 13: textV1.setText("LTE"); break;case 14: textV1.setText("eHRPD"); break; case 15: textV1.setText("HSPA+"); break;}
更多相关文章
- 代码中设置drawableleft
- android 3.0 隐藏 系统标题栏
- Android开发中activity切换动画的实现
- Android(安卓)学习 笔记_05. 文件下载
- Android中直播视频技术探究之—摄像头Camera视频源数据采集解析
- 技术博客汇总
- android 2.3 wifi (一)
- AndRoid Notification的清空和修改
- Android中的Chronometer