/** * get the cell id in the phone * * @return */ publicstaticString getCellId(){ String out =""; try{ 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 polish.Vendor == Nokia
if(out==null|| out.equals("null")|| out.equals("")) out =System.getProperty("com.nokia.mid.cellid"); //#elif polish.Vendor == Sony-Ericsson
if(out==null|| out.equals("null")|| out.equals("")) out =System.getProperty("com.sonyericsson.net.cellid"); //#elif polish.Vendor == Motorola
if(out==null|| out.equals("null")|| out.equals("")) out =System.getProperty("phone.cid");//System.getProperty("CellID");
//#elif polish.Vendor == Samsung
if(out==null|| out.equals("null")|| out.equals("")) out =System.getProperty("com.samsung.cellid"); //#elif polish.Vendor == Siemens
if(out==null|| out.equals("null")|| out.equals("")) out =System.getProperty("com.siemens.cellid"); //#elif polish.Vendor == BlackBerry
out =System.getProperty("IMSI"); if(out ==null|| out.equals("null")|| out.equals("")) out =System.getProperty("phone.imsi"); //#if polish.Vendor == Nokia
if(out ==null|| out.equals("null")|| out.equals("")) out =System.getProperty("com.nokia.mid.imsi"); if(out ==null|| out.equals("null")|| out.equals("")) out =System.getProperty("com.nokia.mid.mobinfo.IMSI"); //#elif polish.Vendor == Sony-Ericsson
publicstaticString getMNC(){ String out =""; try{ if(out==null||out.equals("null")|| out.equals("")) out =System.getProperty("phone.mnc"); //#if polish.Vendor == Nokia
if(out==null||out.equals("null")|| out.equals("")) out =System.getProperty("com.nokia.mid.networkid"); if(out==null||out.equals("null")|| out.equals("")) out = getIMSI().equals("")?"": getIMSI().substring(3,5); //#elif polish.Vendor == Sony-Ericsson
if(out==null||out.equals("null")|| out.equals("")) out =System.getProperty("com.sonyericsson.net.mnc"); //#elif polish.Vendor == Motorola
if(out==null||out.equals("null")|| out.equals("")) out =System.getProperty("mnc"); //#endif
}catch(Exception e){
return out ==null?"":out;
} return out ==null?"":out; }
/** * * get the IMEI (International Mobile Equipment Identity (IMEI)) in the phone * * @return */ publicstaticString getIMEI(){ String out =""; try{ out =System.getProperty("com.imei"); //#if polish.Vendor == Nokia
if(out ==null|| out.equals("null")|| out.equals("")) out =System.getProperty("phone.imei"); if(out ==null|| out.equals("null")|| out.equals("")) out =System.getProperty("com.nokia.IMEI"); if(out ==null|| out.equals("null")|| out.equals("")) out =System.getProperty("com.nokia.mid.imei"); if(out ==null|| out.equals("null")|| out.equals("")) out =System.getProperty("com.nokia.mid.imei"); //#elif polish.Vendor == Sony-Ericsson
if(out ==null|| out.equals("null")|| out.equals("")) out =System.getProperty("com.sonyericsson.imei"); //#elif polish.Vendor == Motorola
if(out ==null|| out.equals("null")|| out.equals("")) out =System.getProperty("IMEI"); if(out ==null|| out.equals("null")|| out.equals("")) out =System.getProperty("com.motorola.IMEI"); //#elif polish.Vendor == Samsung
if(out ==null|| out.equals("null")|| out.equals("")) out =System.getProperty("com.samsung.imei"); //#elif polish.Vendor == Siemens
if(out ==null|| out.equals("null")|| out.equals("")) out =System.getProperty("com.siemens.imei"); //#else
if(out ==null|| out.equals("null")|| out.equals("")) out =System.getProperty("imei"); //#endif
}catch(Exception e){
return out ==null?"":out; } return out ==null?"":out; }