• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to Compress TextMessages

 
Umashanthi Pavalanathan
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I want to know how to compress and send a large amount of characters in one SMS and how to read the compressed SMS from the receipent's phone.
If you have any idea please share yours...
Thanks in Advance,
Umashanthi
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
SMS are limited to about 160 characters, so I don't think you'll be able to send a "large amount" of text.
 
Umashanthi Pavalanathan
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ulf Dittmer ,
Thank you for your reply.
But I heard that we can compress & send SMS having more than 160 characters in one SMS using JavaME.
But I am not sure.
Thanks again,
Umashanthi
 
Eduardo Marques
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A SMS message may be encoded in a long SMS using different SMS segments.
The WMA specification states that at least 3 segments must be supported by an implementation, which gives, depending on the encoding:

GSM-7 bit (ASCII 7-bit) : 435 chars
Binary data (ie binary messages): 400 bytes
Unicode text: 198 messages

See page 28 of appendix A of specs at http://jcp.org/aboutJava/communityprocess/final/jsr120/index2.html.

You can query the number of segments in a SMS message, by using the following code:



Cheers
 
Eduardo Marques
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But note that a device may support more than 3 segments, so these values are minimum guaranteed bounds ...

I doubt however that you may be able to send more than 500 to 1000 chars, so it's wise to compress your data somehow.

Also, use BinaryMessage, not TextMessage if your data scheme does not require text information. The character set in use by the phone (eg if Unicode) may decrease the message capacity heavily.
 
Sayan Jaipan
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use GZip library to compress text string then set payload text with that compressed string.
Receiver need to install a client that support unzipped text message.(J2me + specific port, symbian + native sms inbox)
[ July 29, 2007: Message edited by: Sayan Jaipan ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic