Motorola E680 - Smartphone - GSM Developer's Manual page 58

Micro edition (j2me) applications
Hide thumbs Also See for E680 - Smartphone - GSM:
Table of Contents

Advertisement

byte[] newBin = new byte[size];
}
byte[] newBin = createBinary(msgLength);
binMsg.setPayloadData(newBin);
int num = connClient.numberOfSegments(binMsg);
Setting of MessageListener and receiving of notifications about incoming
messages:
public class JSR120Sample1 extends MIDlet implements
CommandListener {
...
JSR120Sample1Listener listener = new
JSR120Sample1Listener();
...
// open connection
messageConnection =
(MessageConnection)Connector.open("sms://:9532");
...
// create message to send
...
listener.run();
...
// set payload for the message to send
...
// set address for the message to send
messageToSend.setAddress("sms://+18473297274:9532");
...
// send message (via invocation of 'send' method)
...
// set address for the message to receive
receivedMessage.setAddress("sms://:9532");
...
// receive message (via invocation of 'receive' method)
...
class JSR120Sample1Listener implements MessageListener,
58
for (int i = 0; i < size; i++) {
nextByte = (rand.nextInt());
newBin[i] = (byte)nextByte;
if ((size > 4) && (i == size / 2)) {
newBin[i-1] = 0x1b;
newBin[i] = 0x7f;
}
}
return newBin;

Advertisement

Table of Contents
loading

Table of Contents