我已经构建了一个 J2ME 应用程序来通过他们的 Cell ID 跟踪在我的组织下注册的所有卡车司机。该应用程序将每半小时向我们发送一条短信,其中包含相关司机的 LAC、MCC、MNC、Cell ID(以了解他们目前的行踪),并将其以 CSV 格式存储在我们的 DB/Excel 表中。
现在我面临的问题是,在任何启用 Java 的 S40/S60 上安装应用程序后,我怎样才能使界面架构正常工作,即如何继续使应用程序提取详细信息并向我们预定义的号码发送 SMS ?
问题的原因是因为我对“我们无法使用 JAVA ME 在标准端口上接收短信”这句话有点困惑。这是否意味着我们真的无法收到短信?
这是我目前仅适用于诺基亚设备的内容:
/**
* get the cell id in the phone
*
* @return
*/
public static String getCellId(){
String out = "";
try{
out = System.getProperty("Cell-ID");
if(out== null ||out.equals("null")|| out.equals(""))
out = System.getProperty("com.nokia.mid.cellid");
#endif
}catch(Exception e){
return out==null?"":out;
}
return out==null?"":out;
}
/**
* get the LAC string from phone
*/
public static String getLAC(){
String out = "";
try{
out = System.getProperty("phone.lac");
if(out== null ||out.equals("null")|| out.equals(""))
out = System.getProperty("com.nokia.mid.lac");
#endif
}catch(Exception e){
return out==null?"":out;
}
return out==null?"":out;
}
/**
* get the IMSI string from phone
*/
public static String getIMSI(){
String out = "";
try{
out = System.getProperty("IMSI");
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");
#endif
}catch(Exception e){
return out==null?"":out;
}
return out==null?"":out;
}
/**
* get the MCC string from phone
*/
public static String getMCC(){
String out = "";
try{
if(out== null ||out.equals("null")|| out.equals(""))
out = System.getProperty("com.nokia.mid.mobinfo.IMSI");
#endif
}catch(Exception e){
return out==null?"":out;
}
return out==null?"":out;
}
/**
* get the MNC string from phone
*/
public static String getMNC(){
String out = "";
try{
if(out== null ||out.equals("null")|| out.equals(""))
out = getIMSI().equals("")?"": getIMSI().substring(3,5);
#endif
}catch(Exception e){
return out==null?"":out;
}
return out==null?"":out;
}