Motorola E680 Technical Manual - Page 57
Getting of address
View all Motorola E680 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 57 highlights
14 JSR 120 - Wireless Messaging API Getting of payload data of received binary message: BinaryMessage binMsg; byte[] payloadData = binMsg.getPayloadData(); Setting of address with port number: message.setAddress("sms://+18473297274:9532"); Setting of address without port number: message.setAddress("sms://+18473297274"); Sending of message: messageConnection.send(message); Receiving of message: Message receivedMessage = messageConnection.receive(); Getting of address: String address = ((TextMessage)message).getAddress(); Getting of timestamp for the message: Message message; System.out.println("Timestamp: " + message.getTimestamp().getTime()); Creation of client connection, creation of binary message, setting of payload for binary message and calling of method 'numberOfSegments(Message)' for Binary message: BinaryMessage binMsg; MessageConnection connClient; int MsgLength = 140; /* Create connection for client mode */ connClient = (MessageConnection) Connector.open("sms://" + outAddr); /* Create BinaryMessage for client mode */ binMsg = (BinaryMessage)connClient.newMessage(MessageConnection.BINAR Y_MESSAGE); /* Create BINARY of 'size' bytes for BinaryMsg */ public byte[] createBinary(int size) { int nextByte = 0; 57