safedispatch-mobile/libSafeMobile/src/main/java/com/safemobile/lib/SMSmsg.java

54 lines
1.3 KiB
Java

package com.safemobile.lib;
import java.util.ArrayList;
import com.safemobile.lib.SMS;
public class SMSmsg extends TCPmsg {
public ArrayList<SMS> smsList;
public static int count=0;
public SMSmsg(TCPmsg tcp) {
super(tcp);
smsList = new ArrayList<SMS>();
String date4parsing = super.data;
//SM.Debug("SMS date4parsing:"+date4parsing);
String[] tempArr = date4parsing.split(";");
//SM.Debug("SMS tempArr.length:" +tempArr.length);
for(int i =0; i<tempArr.length;i++)
{
//SM.Debug("i:" + i+"Data :"+tempArr[i]);
String[] tempVeh = tempArr[i].split("&");
if(tempVeh.length<7)
continue;
SMS sms = new SMS();
String sm = "";
try {
sms.idx = Integer.parseInt(tempVeh[0]);
sm = sms.idx + "";
sms.status = Integer.parseInt(tempVeh[1]);
sm = sms.status + "";
sms.timeGMT = Integer.parseInt(tempVeh[2]);
sm = sms.timeGMT + "";
sms.mess = tempVeh[3];
sms.sc_id_sour = Integer.parseInt(tempVeh[4]);
sm = sms.sc_id_sour + "";
sms.sc_id_dest = Integer.parseInt(tempVeh[5]);
sm = sms.sc_id_dest + "";
sms.seq_idx = tempVeh[6];
}
catch(Exception ex) {
SM.Exception("Exception in SMSmsg: " + ex.toString() + " | " + sm);
}
smsList.add(sms);
//SM.Debug(sms.toString());
}
count +=this.smsList.size();
//SM.Debug("smsList size:" +this.smsList.size() + " total:" +count);
}
}