CodeGrabber
{ USER }
posts: 23
last: 28-Apr-2008
TITLE: Sending and Receiving SMS from MIDlets
DESCRIPTION: Sending/Receiving SMS from MIDlets
Submitted: 09-Apr-2008 10:57:47 ( 38w 5d 21h ago ) Language: Java (*.java)
Views: 200 Lines of Code: 18 LINES
Rating:
rate: star1
star2
star3
star4
star5
dstar1
dstar2
dstar3
dstar4
dstar5  ( rated! )
  { 0.00 / 5 }
Difficulty: Intermediate
Bookmark
/* Author: CodeGrabber
   Date: 09-04-2008
   Filename: 
   Description: 
   History: 
*/


// Lets send an SMS now.
//get a reference to the appropriate Connection object using an appropriate url
MessageConnection conn = (MessageConnection) Connector.open("sms://:50001");
//generate a new text message
TextMessage tmsg = (TextMessage) conn.newMessage(MessageConnection.TEXT_MESSAGE);
//set the message text and the address
tmsg.setPayloadText(message);
tmsg.setAddress("sms://" + number);
//finally send our message
conn.send();