android中的Gsm网络信息

android中的Gsm网络信息,第1张

概述有人知道如何在 android中获取gsm信息吗?信息如BCCH(广播控制信道)和BCIS(基站识别码).我已经获得了LAC(位置区号)和CID(小区ID).我知道这是一个低级别的信息,但有人知道获取这些信息吗?我很难研究,我对蜂窝网络一无所知.请帮助谢谢:) 这是为您提供gsm网络完整信息的功能. 只需调用您活动的上下文 private void getNWInfo(Context contex 有人知道如何在 android中获取gsm信息吗?信息如BCCH(广播控制信道)和BCIS(基站识别码).我已经获得了LAC(位置区号)和CID(小区ID).我知道这是一个低级别的信息,但有人知道获取这些信息吗?我很难研究,我对蜂窝网络一无所知.请帮助谢谢:)解决方法 这是为您提供gsm网络完整信息的功能.
只需调用您活动的上下文

private voID getNWInfo(Context context) {          /**           * <uses-permission androID:name="androID.permission.READ_PHONE_STATE"           * /> <uses-permission           * androID:name="androID.permission.ACCESS_NETWORK_STATE"/>           */          TelephonyManager telephonyManager = (TelephonyManager) context                       .getSystemService(Context.TELEPHONY_SERVICE);          String networkOperator = telephonyManager.getNetworkOperator();          int mcc = 0,mnc = 0;          if (networkOperator != null) {                 mcc = Integer.parseInt(networkOperator.substring(0,3));                 mnc = Integer.parseInt(networkOperator.substring(3));          }          String SimNumber = telephonyManager.getline1Number();          String SimserialNumber = telephonyManager.getSimserialNumber();          String countryISO = telephonyManager.getSimCountryIso();          String operatorname = telephonyManager.getSimOperatorname();          String operator = telephonyManager.getSimOperator();          int simstate = telephonyManager.getSimstate();          String voicemailNumer = telephonyManager.getVoiceMailNumber();          String voicemailAlphaTag = telephonyManager.getVoiceMailAlphaTag();          // Getting connected network iso country code          String networkCountry = telephonyManager.getNetworkCountryIso();          // Getting the connected network operator ID          String networkOperatorID = telephonyManager.getNetworkOperator();          // Getting the connected network operator name          String networkname = telephonyManager.getNetworkOperatorname();          int networkType = telephonyManager.getNetworkType();          String network = "";          ConnectivityManager cm = (ConnectivityManager) context                       .getSystemService(Context.CONNECTIVITY_SERVICE);          try {                 if (cm.getActiveNetworkInfo().getTypename().equals("MOBILE"))                       network = "Cell Network/3G";                 else if (cm.getActiveNetworkInfo().getTypename().equals("WIFI"))                       network = "WiFi";                 else                       network = "N/A";          } catch (Exception e) {                 // Todo auto-generated catch block                 e.printstacktrace();          }          TextVIEw  textVIEw = (TextVIEw) findVIEwByID(R.ID.textVIEw);          textVIEw.setText("network :" + network +          "\n" + "countryISO : " + countryISO + "\n" + "operatorname : "                       + operatorname + "\n" + "operator :      " + operator + "\n"                       + "simstate :" + simstate + "\n" + "Sim Serial Number : "                       + SimserialNumber + "\n" + "Sim Number : " + SimNumber + "\n"                       + "Voice Mail Numer" + voicemailNumer + "\n"                       + "Voice Mail Alpha Tag" + voicemailAlphaTag + "\n"                       + "Sim State" + simstate + "\n" + "Mobile Country Code MCC : "                       + mcc + "\n" + "Mobile Network Code MNC : " + mnc + "\n"                       + "Network Country : " + networkCountry + "\n"                       + "Network OperatorID : " + networkOperatorID + "\n"                       + "Network name : " + networkname + "\n" + "Network Type : "                       + networkType);   }

你可以在这个博客上找到更多细节

http://khurramitdeveloper.blogspot.in/search?updated-max=2013-11-07T03:23:00-08:00&max-results=7

希望它会帮助你:)

总结

以上是内存溢出为你收集整理的android中的Gsm网络信息全部内容,希望文章能够帮你解决android中的Gsm网络信息所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1129349.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-30
下一篇 2022-05-30

发表评论

登录后才能评论

评论列表(0条)

保存