×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Regular Contributor
    Join Date
    Nov 2007
    Posts
    88

    sending multiple sms in 6210

    Hi

    I have an application where i am sending sms it includes multiple sms also. My application worked fine in N78. But in 6210 it is giving problem.
    the code which i used to send sms is

    MessageConnection conn = null;
    int res = 1;

    try
    {
    conn = (MessageConnection)Connector.open(sn);
    TextMessage msge = (TextMessage)conn.newMessage(MessageConnection.TEXT_MESSAGE);
    msge.setPayloadText(smstext);
    try
    {
    conn.send(msge);
    }
    catch(Exception e)
    {
    System.out.println(e);
    }
    try
    {
    conn.close();
    }
    catch(Exception e)
    {
    System.out.println(e);
    }
    }
    catch(Exception ex)
    {
    System.out.println(ex);
    try
    {
    conn.close();
    }
    catch(Exception e)
    {
    System.out.println(e);
    }
    res = 0;
    }

    return res;

    While sending sms it promts a security message with yes or no options. if i select no it as to return 0.it is working fine when no try catch is applied to conn.send(), but while sending smultiple sms for the second or third sms it returns 0. But when try catch is applied there is no problem with multiple sms sending but while sending sigle sms also if i select No otion also it is returning 1. Please give me the solution

    Regards
    Deepa.G

  2. #2
    Regular Contributor
    Join Date
    Jun 2008
    Location
    Singapore
    Posts
    167

    Re: sending multiple sms in 6210

    Hi,

    Did the second message sent with the user-prompt?

    If there is no prompt for second and next message, probably because the message permission is set to Ask First Time only. Change it to Ask Every Time.

    Rgds
    ---Knowledge sharing is power---

    Hans

  3. #3
    Registered User
    Join Date
    Sep 2007
    Location
    Bangalore
    Posts
    868

    Re: sending multiple sms in 6210

    MessageConnection conn = null;
    TextMessage msge = null;
    int res = 1;

    try {
    conn = (MessageConnection)Connector.open(sn);
    TextMessage msge = (TextMessage)conn.newMessage(MessageConnection.TEXT_MESSAGE);
    msge.setPayloadText(smstext);
    conn.send(msge);
    } catch(Exception ex) {
    ex.printStackTrace();
    res = 0;
    }finally{
    try{
    conn.close();
    msg = null;
    }catch(Exception e){}
    }

    return res;


    Try this code my suspension is your previous connection is not closing that's y you are not able to send the sms.

    use finally block to close the connection. Your close connection is previously it is next to the send sms . When it execute the statement conn.send(msge); the ams put the permission question. If you said no to that the connection will not close at that time. it will catch in catch statement .
    Last edited by bhanuchandar.k; 2008-09-02 at 13:27.

  4. #4
    Regular Contributor
    Join Date
    Nov 2007
    Posts
    88

    Re: sending multiple sms in 6210

    Hi bhanuchandar.k

    I tried your code but the same o/p. While sending multiple sms first sms is sent but for second one it is returnin 0.

    And in permission setting it is Ask Every time only

    Regards
    Deepa.G

  5. #5
    Regular Contributor
    Join Date
    Nov 2007
    Posts
    88

    Re: sending multiple sms in 6210

    Hi bhanuchandar.k

    While sending multiple sms it is working fine now, but when i am going to send a single sms it promts the message there i select NO option , then also it is returning 1

    Regards
    Deepa.G

  6. #6
    Registered User
    Join Date
    Sep 2007
    Location
    Bangalore
    Posts
    868

    Re: sending multiple sms in 6210

    MessageConnection conn = null;
    TextMessage msge = null;
    int res = 1;

    try {
    conn = (MessageConnection)Connector.open(sn);
    TextMessage msge = (TextMessage)conn.newMessage(MessageConnection.TEXT_MESSAGE);
    msge.setPayloadText(smstext);
    conn.send(msge);
    } catch(Exception ex) {
    ex.printStackTrace();
    res = 0;
    }finally{
    try{
    conn.close();
    msg = null;
    }catch(Exception e){}
    }

    return res;

  7. #7
    Regular Contributor
    Join Date
    Nov 2007
    Posts
    88

    Re: sending multiple sms in 6210

    Hi bhanuchandar.k


    I already tried this one. While sending single sms if i select No it will return 0 only but while sending multiple sms , after sending first sms it will promt for the second sms insted it return 0 .

    Regards
    Deepa.G

Similar Threads

  1. Problem sending SMS using Nokia 6210 and SDK 2.1
    By tarnaigy in forum PC Suite API and PC Connectivity SDK
    Replies: 4
    Last Post: 2006-02-01, 22:01
  2. SMS - "Message sending failed"
    By TheCyclops in forum Symbian
    Replies: 1
    Last Post: 2003-05-13, 06:24
  3. Sending SMS to Multiple Reciptents
    By anil_kumar_g in forum PC Suite API and PC Connectivity SDK
    Replies: 0
    Last Post: 2002-10-31, 07:00
  4. CSendAs / SMS Sending
    By jimdeal in forum Symbian
    Replies: 1
    Last Post: 2002-09-04, 15:05
  5. Sending Unicode (Arabic) SMS to 6210 direct to INBOX?
    By buafnan in forum General Messaging
    Replies: 1
    Last Post: 2002-06-03, 07:25

Posting Permissions

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