I have being tryn to send and recieve sms from j2me emulator. I cameup with following code inorder to send the sms
String mno=toWhom.getString(); // mno= massage number
String msg=message.getString();
try {
clientConn=(MessageConnection)Connector.open("sms://"+mno); //MessageConnection clientConn;
}
catch(Exception e) {
alert = new Alert("Alert");
alert.setString("Unable to connect to Station because of network problem");
alert.setTimeout(2000);
display.setCurrent(alert);
}
try {
TextMessage textmessage = (TextMessage) clientConn.newMessage(MessageConnection.TEXT_MESSAGE);
textmessage.setAddress("sms://"+mno);
textmessage.setPayloadText(msg);
clientConn.send(textmessage);
System.out.println("text msg sent");
}
catch(Exception e)
{
Alert alert=new Alert("Alert","",null,AlertType.INFO);
alert.setTimeout(Alert.FOREVER);
alert.setString("Unable to send");
display.setCurrent(alert);
}
This just executes without any error.
But i have no idea on how to recieve the massage send or where this massage is sent internally or how to manage it. please help me with this. I use WTK 2.5.2 & wireless massaging API 2.0