3
如何獲取諾基亞E71的cell id,MCC,LAC?無法通過J2ME代碼找到諾基亞e71中的Cellid,MCC,MNC,LAC值
我正在使用下面的代碼,但無法找到cellid,MCC,LAC值。
我試圖通過j2me代碼找到這個值。
請幫我找到這個值
代碼來獲得小區ID:
公共靜態字符串getCellId(){ 串出= 「」; 嘗試{
out = System.getProperty("Cell-ID"); // if (out == null || out.equals("null") || out.equals("")) { // out = System.getProperty("CellID"); // } // if
(出== NULL || out.equals( 「空」)|| 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; }
u使用我的代碼或不
public static String getMCC(){ String out =「」; (out == null || out.equals(「null」)|| out.equals(「」)){ out = System.getProperty(「com.nokia.mid.countrycode」); } } catch(Exception e){ return out == null? 「」:out; } return out == null? 「」:out; } –
通過此代碼我得到了MCC。我解決我的問題我的自我 –
我有我使用諾基亞C1手機和cellid出現null的相同問題你能說我該如何解決它? –