public class SMSSender implements Runnable
{
public void run()
{
String number = null;
String address = null;
MessageConnection conn = null;
try
{
conn = (MessageConnection) Connector.open("sms://3481234567");
TextMessage msg = (TextMessage) conn.newMessage(
MessageConnection.TEXT_MESSAGE);
msg.setPayloadText("Ciao");
conn.send(msg);
}
catch (IOException e)
{
e.printStackTrace();
}
finally
{
try
{
if (conn != null)
conn.close();
}
catch (IOException e)
{
e.printStackTrace();
}
}
}
}