Hi All,
I have developed an j2me application in which i am sending sms to no of contacts.Its successfully sendinng sms but those are not updating on the "Sent Items" folder in the device.Please clarify me.
Please note the part of code i have used to send the sms
Code:private MessageConnection connection=null; public void sendFunction() { try { // Open the connection if(connection==null) connection = (MessageConnection)Connector.open("sms://:50000"); TextMessage message = prepareSMS(receiverNumber); connection.send(message); }catch (InterruptedIOException ex) { errorCode=1; System.out.println("Exc in send SMS Inter"); // this.listenerObj.showMessage("","Exc in send SMS Inter"); // TODO: Exception (e.g. timeout) handling }catch (IOException ex) { errorCode=2; System.out.println("Exc in send SMS IOExce"); //this.listenerObj.showMessage("","Exc in send SMS IOExce"); // TODO: Exception (e.g. network failure) handling }catch (IllegalArgumentException ex) { errorCode=3; System.out.println("Exc in send SMS iLLega"); //this.listenerObj.showMessage("","Exc in send SMS iLLega"); // TODO: Exception (e.g. too big or otherwise invalid // message) handling }catch (SecurityException ex) { errorCode=4; System.out.println("Exc in send SMS Security"); //this.listenerObj.showMessage("","Exc in send SMS Security"); // TODO: Exception (e.g. insufficient permissions) // handling }catch(Exception ex) { errorCode=6; } catch (Exception ex) { //this.showMessage("Exception occured inhandleSend Command"); // TODO: Exception handling } } /** * Sets the destination address and payload text for the text SMS. */ private TextMessage prepareSMS(String receiverNumber) { // Prepare the text message TextMessage message = (TextMessage)connection.newMessage(MessageConnection.TEXT_MESSAGE); // Set the destination address String number = "sms://"+receiverNumber; message.setAddress(number); // Obtain the specified text and set it as the payload String smsStr="Test SMS" message.setPayloadText(smsStr); return message; }

Reply With Quote



