Sending SMS to other mobile geting exception as java.lang.IllegalArgumentException
Hi,
Good Day!
I am creating an application for sending SMS to other mobile (Without port).
That application is working fine in emulator.
But when I am installing on mobile (Nokia N73) it is throwing exception as "java.lang.IllegalArgumentException" while sending the SMS.
The code is as follows:
public void run ()
{
try
{
String addr = "sms://+dest.getString();
MessageConnection conn = (MessageConnection) Connector.open(addr);
TextMessage msg = (TextMessage) conn.newMessage(MessageConnection.TEXT_MESSAGE);
msg.setPayloadText("Test");//textMesg.getString());
conn.send(msg);
Alert a = new Alert("Success!","Message sent successfully", null,AlertType.INFO);
a.setTimeout(3000);
disp.setCurrent(a);
conn.close();
}
catch (Exception e)
{
System.out.println("Error in sending");
e.printStackTrace ();
Alert a = new Alert("No!",e.getMessage() + e.toString(), null,AlertType.INFO);
a.setTimeout(-2);
disp.setCurrent(a);
}
}
Please help me.... It is very urgent...
Thanks!