Package javax.wireless.messaging

Examples of javax.wireless.messaging.MultipartMessage


            subjectField.setFocus();
        } else if (message.length() == 0) {
            errorDialog("Message field cannot be blank");
            messageField.setFocus();
        } else {
            MultipartMessage multipartMessage = null;
            try {
                // Open an MMS connection for sending
                _sendConn = Connector.open("mms://" + address + ":" + APP_ID);

                // Create the multipart message and set the subject
                multipartMessage =
                        (MultipartMessage) ((MessageConnection) _sendConn)
                                .newMessage(MessageConnection.MULTIPART_MESSAGE);
                multipartMessage.setSubject(subject);

                // Add the message text to the multipart message
                multipartMessage.addMessagePart(new MessagePart(message
                        .getBytes(), "text/plain", "text", null, null));

                // Add any attachments
                for (int i = 0; i < _messageParts.getNumberOfRows(); i++) {
                    multipartMessage.addMessagePart((MessagePart) _messageParts
                            .getRow(i));
                }
            } catch (final IOException ioe) {
                errorDialog(ioe.toString() + " when creating message.");
            }
View Full Code Here


                    // Open an MMS connection for receiving
                    _recConn = Connector.open("mms://:" + APP_ID);

                    for (;;) {
                        // Wait for an MMS
                        final MultipartMessage multipartMessage =
                                (MultipartMessage) ((MessageConnection) _recConn)
                                        .receive();

                        // Process the MMS in an other thread so this thread can
                        // continue to listen for messages without interruption.
View Full Code Here

TOP

Related Classes of javax.wireless.messaging.MultipartMessage

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.