Package javax.wireless.messaging

Examples of javax.wireless.messaging.TextMessage


    /**
     * @see ReceiveListenerRegistry#fireAll()
     */
    public void fireAll() {
        while( !messages.isEmpty() ) {
            final TextMessage msg = (TextMessage) messages.elementAt( 0 );
            uiApplication.invokeLater( new Runnable() {
                public void run() {
                    new callbackDispatchThread( msg ).start();
                }
            } );
View Full Code Here


     *            The MessageConnection source with which to create the Message from
     * @return The Message object representing the SMS message
     */
    public Message toMessage( MessageConnection mc ) {
        String addressString = "//" + _phoneNumber;
        TextMessage m = (TextMessage) mc.newMessage( MessageConnection.TEXT_MESSAGE, addressString );
        m.setPayloadText( _body );
        return m;
    }
View Full Code Here

  {
    try
    {
     
      MessageConnection conn = (MessageConnection)Connector.open(number);
      TextMessage msg = (TextMessage)conn.newMessage(MessageConnection.TEXT_MESSAGE);
      msg.setPayloadText(text);
      conn.send(msg);
      Dialog.show("", Contents.done, null, Dialog.TYPE_CONFIRMATION, null, 3000);
      //midlet.display.setCurrent(Contents.done, midlet.getGuiRosterItem());

    }
View Full Code Here

       
      }
      else //show the arrived sms
      {
        MessageConnection con = (MessageConnection)Connector.open(conn);
        TextMessage msg;
        msg = (TextMessage)con.receive();
        text = msg.getPayloadText();
        Dialog.show("SMS", text, null, Dialog.TYPE_CONFIRMATION,null, 4000);
       
       
      }
View Full Code Here

    private void receivedSmsMessage(final Message m) {
        final String address = m.getAddress();
        String msg = null;

        if (m instanceof TextMessage) {
            final TextMessage tm = (TextMessage) m;
            msg = tm.getPayloadText();
        }

        final StringBuffer sb = new StringBuffer();
        sb.append("Received:");
        sb.append('\n');
View Full Code Here

                    "//"
                            + _address
                            + (_port.equals(NON_ZERO_PORT_NUMBER) ? ":" + _port
                                    : "");

            final TextMessage m =
                    (TextMessage) mc.newMessage(MessageConnection.TEXT_MESSAGE,
                            addressString);
            m.setPayloadText(_msg);

            return m;
        }
View Full Code Here

TOP

Related Classes of javax.wireless.messaging.TextMessage

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.