Results 1 to 2 of 2
  1. #1
    maruffaiz is offline Member
    Join Date
    Apr 2009
    Posts
    6
    Rep Power
    0

    Lightbulb Sending SMS to other mobile geting exception as java.lang.IllegalArgumentException

    Hi,
    Good Day!

    I am creating an application for sending SMS to other mobile (Without port).
    That application is working fine in emulator.
    But when I am installing on mobile (Nokia N73) it is throwing exception as "java.lang.IllegalArgumentException" while sending the SMS.

    The code is as follows:

    public void run ()
    {
    try
    {
    String addr = "sms://+dest.getString();
    MessageConnection conn = (MessageConnection) Connector.open(addr);
    TextMessage msg = (TextMessage) conn.newMessage(MessageConnection.TEXT_MESSAGE);
    msg.setPayloadText("Test");//textMesg.getString());
    conn.send(msg);
    Alert a = new Alert("Success!","Message sent successfully", null,AlertType.INFO);
    a.setTimeout(3000);
    disp.setCurrent(a);
    conn.close();
    }
    catch (Exception e)
    {
    System.out.println("Error in sending");
    e.printStackTrace ();
    Alert a = new Alert("No!",e.getMessage() + e.toString(), null,AlertType.INFO);
    a.setTimeout(-2);

    disp.setCurrent(a);
    }
    }


    Please help me.... It is very urgent...
    Thanks!

  2. #2
    Join Date
    Aug 2009
    Posts
    17
    Rep Power
    0

    Default

    Hi,

    Is your application signed? Because you are using secure API. So you have to first sign ur application. In emulator there is no need of signing, But if run ur application on actual device then it is required.

    Thanks
    Abhijeet Namdeo

Similar Threads

  1. sending SMS between PC and mobile
    By Halayas in forum Sun Java Wireless Toolkit
    Replies: 6
    Last Post: 03-18-2010, 12:45 PM
  2. Sending sms on mobile
    By anjali in forum Advanced Java
    Replies: 7
    Last Post: 04-01-2009, 09:25 AM
  3. Exception java.lang.NumberFormatException
    By vasavi.singh in forum New To Java
    Replies: 3
    Last Post: 02-24-2009, 07:27 AM
  4. java.lang.StackOverFlowError exception
    By jayaj in forum NetBeans
    Replies: 1
    Last Post: 06-08-2008, 12:17 PM
  5. Replies: 1
    Last Post: 08-06-2007, 07:04 PM

Posting Permissions

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