无法通过J2ME代码在诺基亚e71中找到Cellid,MCC,MNC,LAC值

时间:2012-06-28 07:03:19

标签: java-me netbeans-7

如何获取诺基亚E71的手机ID,MCC,LAC?

我使用的是以下代码但无法找到cellid,MCC,LAC值。

我尝试通过j2me代码找到这个值。

请帮我找到这个值

获取单元格ID的代码:

  

public static String getCellId(){           String out =“”;           试试{

        out = System.getProperty("Cell-ID"); //            if (out == null || out.equals("null") || out.equals("")) { //                out = System.getProperty("CellID"); //            } //            if
     

(out == null || out.equals(“null”)|| out.equals(“”)){//
  System.getProperty( “phone.cid”); //}

        if (out == null || out.equals("null") || out.equals("")) {
            out = System.getProperty("com.nokia.mid.cellid");
        }


    } catch (Exception e) {
        return out == null ? "" : out;
    }

    return out == null ? "" : out;
}

获取LAC的代码:

public static String getLAC() {
        String out = "";
        try {

            if (out == null || out.equals("null") || out.equals("")) {
                out = System.getProperty("com.nokia.mid.lac");
            }


        } catch (Exception e) {
            return out == null ? "" : out;
        }

        return out == null ? "" : out;
    }

获取IMSI的代码:

 public static String getIMSI() {
        String out = "";
        try {

            out = System.getProperty("IMSI");

            if (out == null || out.equals("null") || out.equals("")) {
                System.getProperty("phone.cid");
            }
            if (out == null || out.equals("null") || out.equals("")) {
                out = System.getProperty("com.nokia.mid.mobinfo.IMSI");
            }

            if (out == null || out.equals("null") || out.equals("")) {
                out = System.getProperty("com.nokia.mid.imsi");
            }


        } catch (Exception e) {
            return out == null ? "" : out;
        }

        return out == null ? "" : out;
    }

获取MCC的代码:

public static String getMCC() {
        String out = "";
        try {

            if (out == null || out.equals("null") || out.equals("")) {
                out = System.getProperty("phone.mcc");
            }

            if (out == null || out.equals("null") || out.equals("")) {
                out = System.getProperty("com.nokia.mid.mobinfo.IMSI");
            }


            if (out == null || out.equals("null") || out.equals("")) {
                out = getIMSI().equals("") ? "" : getIMSI().substring(0, 3);
            }

            if (out == null || out.equals("null") || out.equals("")) {
                out = System.getProperty("com.siemens.imei");
            }

            if (out == null || out.equals("null") || out.equals(""))//getMNC()

            {
                if (out == null || out.equals("null") || out.equals("")) {
                    out = System.getProperty("mcc");
                }
            }


        } catch (Exception e) {
            return out == null ? "" : out;
        }

        return out == null ? "" : out;
    }

获取MNC的代码:

public static String getMNC() {
        String out = "";
        try {

            if (out == null || out.equals("null") || out.equals("")) {
                out = System.getProperty("phone.mnc");
            }

            if (out == null || out.equals("null") || out.equals("")) {
                out = getIMSI().equals("") ? "" : getIMSI().substring(3, 5);
            }


           if (out == null || out.equals("null") || out.equals("")) {
                out = getIMSI().equals("") ? "" : getIMSI().substring(3, 5);
            }


           if (out == null || out.equals("null") || out.equals(""))//getMNC()

            {
                if (out == null || out.equals("null") || out.equals("")) {
                    out = System.getProperty("mnc");
                }
            }


        } catch (Exception e) {
            return out == null ? "" : out;
        }

        return out == null ? "" : out;
    }

你是否使用我的代码

1 个答案:

答案 0 :(得分:0)

就诺基亚而言,您需要让运营商签署您的应用程序,以便您能够访问这些详细信息。