j2me 获得基站id

这个就是取得基站ID的代码。。。。但是,绝大多数J2ME手机都是读取不了CELL ID 或者LAC,为什么读取不了?因为读取CELL ID 和 LAC压根就不是规范之一,厂家对其支持参差不齐。。。。

 

String info = System.getProperty("microedition.platform");
  //获取到imei号码
  String imei = "";
  //cellid
  String cellid = "";
  //lac
  String lac = "";
  // #if polish.vendor==Sony-Ericsson
  imei = System.getProperty("com.sonyericsson.imei");
  //参考 http://forums.sun.com/thread.jspa?threadID=5278668
  //https://developer.sonyericsson.com/message/110949
  cellid = System.getProperty("com.sonyericsson.net.cellid");
  //获取索爱机子的
  lac = System.getProperty("com.sonyericsson.net.lac");
  // #else if polish.vendor==Nokia
  imei = System.getProperty("phone.imei");
  if (imei == null || "".equals(imei)) {
  imei = System.getProperty("com.nokia.IMEI");
  }
  if (imei == null || "".equals(imei)) {
  imei = System.getProperty("com.nokia.mid.imei");
  }
  //获取到cellid
  //参考http://wiki.forum.nokia.com/index.php/CS000947_-_Getting_Cell_ID_in_Java_ME
  // #if polish.group==Series60
  cellid = System.getProperty("com.nokia.mid.cellid");
  // #else if polish.group==Series40
  cellid = System.getProperty("Cell-ID");
  // #endif
  // #else if polish.vendor==Siemens
  imei = System.getProperty("com.siemens.imei");
  // #else if polish.vendor==Motorola
  imei = System.getProperty("com.motorola.IMEI");
  //cellid 参考 http://web.mit.edu/21w.780/www/spring2007/guide/
  cellid = System.getProperty("CellID");
  lac=System.getProperty("LocAreaCode"); 
  // #else if polish.vendor==Samsung
  imei = System.getProperty("com.samsung.imei");
  // #endif

  if (imei == null || "".equals(imei)) {
  imei = System.getProperty("IMEI");
  } 
 

你可能感兴趣的:(Web,PHP,.net,Nokia,Motorola)