Categories: Java | Java ME | How To | Code Examples | Messaging | SMS
This page was last modified 08:41, 25 September 2007.
How to send Binary SMS in Java ME
From Forum Nokia Wiki
The following Java ME tip explains a method of sending binary messages such as PNG images, sound files etc. In the program BinaryMessage interface represents a binary message. The setPayloadData() method sets the value of the payload in the data container without checking whether the value is valid or not.
void sendSMS(byte data[]) { try { String destAddress = "sms://9772625262:5000"; MessageConnection smsConnection = (MessageConnection)Connector.open(destAddress); //Create binary message BinaryMessage binaryMSG = (BinaryMessage)smsConnection.newMessage( MessageConnection.BINARY_MESSAGE); //Setting destination add binaryMSG.setAddress(destAddress); //Add payload data binaryMSG.setPayloadData(data); //Now send the message smsConnection.send(binaryMSG); smsConnection.close(); } catch(Exception e) { }
}
| Related Discussions | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| wAp PUsh in CDMA | fisip_99 | Smart Messaging | 2 | 2003-12-04 03:10 |
| New feature? | tonino12345 | Python | 0 | 2005-10-30 10:59 |
| SMS messaging in Java | algedi | PersonalJava | 1 | 2002-05-23 15:25 |
| Use Nokia Dev Suite for Java 2 to send SMS | gfawkes | General Messaging | 0 | 2004-01-13 23:48 |
| Smart Messaging API? | chibioni | Smart Messaging | 1 | 2004-10-27 01:46 |
