Skip to content

Instantly share code, notes, and snippets.

View reflog's full-sized avatar

Ilya Yakelzon reflog

View GitHub Profile
public static boolean SendSMS(String phone, String text){
try {
String smsurl = "sms://+"+phone;
MessageConnection conn =
(MessageConnection)Connector.open(smsurl);
TextMessage msgOut = (TextMessage) conn.newMessage(MessageConnection.TEXT_MESSAGE);
msgOut.setPayloadText(text);
Utils.log("sending to "+smsurl);
conn.send(msgOut);
return true;