Meaningless Drivel is fun!*
The moose likes Java Micro Edition and the fly likes sending sms! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "sending sms!" Watch "sending sms!" New topic
Author

sending sms!

Mateen Dar
Ranch Hand

Joined: Jan 14, 2005
Posts: 55
hi my service number for my phone company is +92300000042 . how do i use this to send sms to a phone nummer
Mateen Dar
Ranch Hand

Joined: Jan 14, 2005
Posts: 55
i have read about the wma form java. could u please give a small example. thanks
Mateen Dar
Ranch Hand

Joined: Jan 14, 2005
Posts: 55
String addr = "sms://" + destination;

MessageConnection sender = null;

try {

try {

//connection creation

sender = (MessageConnection) Connector.open(addr);

//message creation

TextMessage msg = (TextMessage) sender.newMessage(MessageConnection.TEXT_MESSAGE);

//message is load

msg.setPayloadText(message);

//send it

sender.send(msg);



} finally {

sender.close();



}

} catch (Exception ex) {

//handle exception

}





what format must the destination be in .. i have a service number a port and a phone number ...
 
wood burning stoves
 
subject: sending sms!
 
Similar Threads
JMS/SMS problem
struts + sending sms on registration
Is it possible to do this?
J2ME application sends SMS only to java supported mobile phones
i am new for java & have a doubt, java code for send sms to phone via internet