Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    May 2013
    Posts
    159

    how to send message grater than 160 character lenght

    hello, i am working on nokia asha sdk2.0 using s40-with-theme.my problem is that i am sending message from following code but my issue is that when i set the string in textArea of lenght more than 160 charcter.But when now i send the message more than 160 charcter i got the exception
    java.lang.IllegalArgumentException: Too big message
    i used following code
    Code:
    String addr = "sms://"+phone;
    							// opens connection
    							MessageConnection conn = (MessageConnection) Connector.open(addr);
    							// prepares text message
    							TextMessage msg =(TextMessage)conn.newMessage(MessageConnection.TEXT_MESSAGE);
    							
    							//set text
    							msg.setPayloadText(message);
    							// send message
    							conn.send(msg);
    							conn.close();
    PLEASE HELP,THANKS

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,807

    Re: how to send message grater than 160 character lenght

    You can try if MultipartMessage (+MessageConnection.MULTIPART_MESSAGE) is supported for SMS.

  3. #3
    Registered User
    Join Date
    May 2013
    Posts
    159

    Re: how to send message grater than 160 character lenght

    i used code
    MultipartMessage msg = (MultipartMessage)conn
    .newMessage(MessageConnection.MULTIPART_MESSAGE);
    instead of
    TextMessage msg =(TextMessage)conn.newMessage(MessageConnection.MULTIPART_MESSAGE);
    then a red under line show on
    msg.setPayloadText(message);
    it show on mouseover"setPayloadText(message) is undefined for MultiPartMessage "
    so please tell me how can i used this in proper way.

  4. #4
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,807

    Re: how to send message grater than 160 character lenght

    Checking the documentation (http://developer.nokia.com/Resources...D6C/index.html) or using code completion is sometimes a good idea, then you would see what methods MultipartMessage has. Like addMessagePart.

  5. #5
    Registered User
    Join Date
    May 2013
    Posts
    159

    Re: how to send message grater than 160 character lenght

    Thanks for reply ,I checked link as u send me but in this link there is no use of multipartMessage .so please give me some other idea to use it properly..

  6. #6
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    3,087

    Re: how to send message grater than 160 character lenght

    Refer to - http://developer.nokia.com/Community...SMS_in_Java_ME

    Remember that a single message has a maximum size (140 bytes, which translates to 160 7-bit characters). If your message is too long to fit in one message it can be splitt to a maximum of three SMS, this is handled automatic by the WMA implementation.

    If its more then 3x160 then it will fail, try to test your app on some other device its failing for say msg size of about 200 characters. Which device you are testing it on.
    thanks,
    ~Amitabh
    (Champion of the Month -Aug'13)
    Follow me on my blog for Innovative Mobile Apps

  7. #7
    Super Contributor
    Join Date
    Mar 2003
    Location
    Finland
    Posts
    9,571

    Re: how to send message grater than 160 character lenght

    Quote Originally Posted by im2amit View Post
    a single message has a maximum size (140 bytes, which translates to 160 7-bit characters)
    or 70 16-bit Unicode characters.

    Keyword to search for details: "SMS alphabet". E.g., http://en.wikipedia.org/wiki/GSM_03.38

Similar Threads

  1. Spliting the character in message
    By lakshmishar in forum Symbian
    Replies: 4
    Last Post: 2012-01-09, 08:41
  2. HOw to Send SMS in a different character encoding ?
    By symsahoo in forum General Messaging
    Replies: 1
    Last Post: 2005-11-14, 09:39
  3. How to send Chinese character SMS Alert
    By eugeniafpm in forum Smart Messaging
    Replies: 0
    Last Post: 2004-04-15, 04:22
  4. How to send unicode character over sms?
    By vifuer in forum Symbian
    Replies: 0
    Last Post: 2003-08-06, 05:08
  5. how to send UCS character
    By pautamo in forum Smart Messaging
    Replies: 1
    Last Post: 2002-12-19, 05:48

Posting Permissions

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