Revision as of 03:32, 24 July 2013 by hamishwillee (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

How to send Binary SMS in Java ME

From Nokia Developer Wiki
Jump to: navigation, search

This Java ME code snippet shows 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.

Article Metadata
Created: wang_shui (21 Mar 2007)
Last edited: hamishwillee (24 Jul 2013)
public boolean sendSMS(byte data[]) {
boolean result = true;
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
//Add payload data
//Now send the message
} catch (Exception e) {
result = false;
return result;
This page was last modified on 24 July 2013, at 03:32.
63 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.


Thank you!

We appreciate your feedback.