Search This Blog

Tuesday, 1 January 2013

send SMS via code - Blackberry

Hello friends,
                    Here is the simplest way to send an SMS from your app automatically....in Blackberry. :)




CODE:


String _no = "122344556767";
String _msg = "hello this is a test SMS.";
DatagramConnection _dc = null;
String _openString = "sms://";

try{
_dc = (DatagramConnection)Connector.open(_openString);
byte[] data = _msg.getBytes();
Datagram d = _dc.newDatagram(_dc.getMaximumLength());
d.setAddress("//"+_no);
_dc.send(d);

}catch(Exception e){

}

1 comment:

  1. Before I started actively using the global SMS service, I consulted with experts go to https://www.intistele.com/solutions/business_owners/. A few questions that I didn't quite understand before became clear. After that, I appreciated the real benefits of using GSM traffic in working with consumers of our products.

    ReplyDelete