I have a midlet which sends an sms to a desired number. The midlet works fine on Nokia N70 and Nokia 6300. But while using on Samsung Champ, I am able to send an SMS only once to a certain number i.e. it works fine when sending SMS to a number but it does not work when the same or a different SMS is sent to the SAME number. It does not give any exception(s) or error(s). Here is the code I am using:
public boolean sendSMS(String contactNum, String payloadText) {
try {
String addr = "sms://" + contactNum;
MessageConnection conn = (MessageConnection) Connector.open(addr);
TextMessage msg = (TextMessage) conn.newMessage(MessageConnection.TEXT_MESSAGE);
msg.setPayloadText(payloadText);
if (conn.numberOfSegments(msg) == 0) {
return false;
}
conn.send(msg);
} catch (Exception e) {
new AlertDialog("Exception", "Exception in sendSMS() occurred", "OK").show();
}
return true;
}
Please somebody guide me in this regard.
Thanks.