×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Oct 2005
    Posts
    3

    When I cancel send SMS using JSR-120, why it throws SecurityException?

    Hi buddy:

    I wrote those code for sending sms using JSR-120:
    ------------------------------------------------------------------
    public void send(String num, String text) {
    String url = "sms://" + num;
    try {
    conn = (MessageConnection) Connector.open(url);
    TextMessage msg = (TextMessage) conn.newMessage(MessageConnection.TEXT_MESSAGE);
    msg.setPayloadText(text);
    conn.send(msg);
    conn.close();

    } catch (IOException e) {
    e.printStackTrace();
    } catch (SecurityException e1) {
    e1.printStackTrace();
    }
    }
    -----------------------------------------------------------------

    When I call this function in my MIDlet, it appear a dialog box asked me whether I send this SMS, when I choose yes, it's OK,
    but when I choose no, MIDlet will throw a SecurityException, why???
    Is there any relationship?

    Thanks & Regards

  2. #2
    Super Contributor
    Join Date
    Mar 2005
    Location
    Paris
    Posts
    814

    Re: When I cancel send SMS using JSR-120, why it throws SecurityException?

    any time the user is asked for permission, there might be an exception thrown if the answer is no
    if your midlet tries to send an sms and you don't authorize it, it throws a security exception.
    this is perfectly normal, and also warn you that the sms is not send

  3. #3
    Registered User
    Join Date
    Oct 2005
    Posts
    3

    Thumbs up Re: When I cancel send SMS using JSR-120, why it throws SecurityException?

    Thanks a lot

Similar Threads

  1. can not successfully link any sample using .NET
    By lobotomat in forum Symbian Tools & SDKs
    Replies: 2
    Last Post: 2002-08-20, 00:29
  2. Replies: 1
    Last Post: 2002-07-23, 14:39
  3. Replies: 1
    Last Post: 2002-07-22, 11:08
  4. Replies: 0
    Last Post: 2002-06-03, 03:13
  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
  •  
×