×

Discussion Board

Results 1 to 5 of 5

Thread: Receiver sms

  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    44

    Wink Receiver sms

    Hello everyone
    I want to do an app that sends a message and now I´m using Wireless Messaging API, and reads the inputs sms... I know how to send a sms, but how I receive a sms??
    Best regards
    Miriam

  2. #2
    Registered User
    Join Date
    Sep 2004
    Posts
    23

    Re: Receiver sms

    You can find the JSR-120 specification from Java Community Process site:

    http://www.jcp.org

    About sending and receiving methods:

    receive()
    Declaration:
    public javax.wireless.messaging.Message receive()
    throws IOException, InterruptedIOException
    Description:
    Receives a message.
    If there are no Messages for this MessageConnection waiting, this method will block until either a
    message for this Connection is received or the MessageConnection is closed.
    Returns: a Message object representing the information in the received message
    Throws:
    java.io.IOException - if any of these situations occur:
    • there is an error while receiving a message
    • this method is called while the connection is closed
    • this method is called on a client mode MessageConnection
    java.io.InterruptedIOException - if this MessageConnection object is closed during
    this receive method call
    java.lang.SecurityException - if the application does not have permission to receive messages using the
    given port number



    send(Message)
    Declaration:
    public void send(javax.wireless.messaging.Message msg)
    throws IOException, InterruptedIOException
    Description:
    Sends a message.
    Parameters:
    msg - the message to be sent
    Throws:
    java.io.IOException - if the message could not be sent or because of network failure or if the
    connection is closed
    java.lang.IllegalArgumentException - if the message is incomplete or contains invalid
    information. This exception is also thrown if the payload of the message exceeds the maximum length
    for the given messaging protocol. One specific case when the message is considered to contain invalid
    information is if the Message is not of the right type to be sent using this MessageConnection;
    the Message should be created using the newMessage() method of the same
    MessageConnection as will be used for sending it to ensure that it is of the right type.
    java.io.InterruptedIOException - if a timeout occurs while either trying to send the
    message or if this Connection object is closed during this send operation
    java.lang.NullPointerException - if the parameter is null
    java.lang.SecurityException - if the application does not have permission to send the message

  3. #3
    Registered User
    Join Date
    Mar 2003
    Posts
    44

    Thumbs up Re: Receiver sms

    Thanks a lot for your help I´ll check your information
    Best regards
    Miriam

  4. #4
    Regular Contributor
    Join Date
    Oct 2005
    Location
    London, UK
    Posts
    235

    Re: Receiver sms

    Just to note, your MIDlet won't read messages that arrive on the phone throught Port:0 (the default sms port), you have to listen for messages on a different unused port for incoming messages. Which means, the sent message has to be sent using the same port number.

    ViruDoshi
    ~ No Style Without Substance ~

  5. #5
    Registered User
    Join Date
    Mar 2003
    Posts
    44

    Re: Receiver sms

    A lot of thanks for your answer...
    Best regards
    Miriam

Similar Threads

  1. Can I test SMS receiver on the phone without port number?
    By brighteyes in forum Mobile Java General
    Replies: 10
    Last Post: 2007-11-26, 23:38
  2. Replies: 2
    Last Post: 2007-11-10, 13:19
  3. Replies: 1
    Last Post: 2005-12-01, 23:57
  4. Error sending SMS
    By jorge_c in forum Multimodecards
    Replies: 0
    Last Post: 2003-10-07, 11:53
  5. Replies: 0
    Last Post: 2002-06-03, 03:11

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×