Everything Motorola Q  
Home Motorola Q Store Moto Q Software News Moto Q Blog Motorola Q Reviews Moto Q Forums FAQs Wiki Contact Us Everything Q RSS feed


Go Back   Motorola Q Forum | Everything Q > Q Software Developers > Software Developers

Notices

Reply
 
Thread Tools Display Modes
Old 04-03-2008, 04:49 PM   #1 (permalink)
 
Join Date: Apr 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
somuch is on a distinguished road
Default WM6 SmsMessage object sends unicode text messages

When sending an SMS from a C# application on our new Motorola Q9m, I find that I can only send 70-80 characters. If I send more than 70-80 characters, I get "Error sending Sms Message" when the Send() method is executed.

To send the full 160 characters usually available in an SMS message, I need the SmsMessage object to encode the sms.Body property as a GSM (7-bit ASCII) encoded type. Apparently, the Pocket Outlook SmsMessage object's Body property defaults to UCS-2(Unicode) on both the Q9m phone and on Microsoft's WM6 emulators.

1. Can anyone tell me how to set the encoding type for the sms.Body property using managed code?

Since my application must run on different phones, and I may have to programmatically limit characters per message to less than 160 or 80 depending on:
a. whether the sms.Body encoding is GSM or USC-2
b. on whether the language of the message is English or an International
c. on whether the phone is WM5 or WM6 based (when the SmsMessage object is used under WM5 the encoding is apparently GSM)


2. Can anyone tell me how to determine what encoding the sms.Body property is using?


3. Finally, Verizon or other servers that relay text messages seem to have limits on the length of USC-2 messages, I found that the message can be short enough to send using the SmsMessage object, but too long to be relayed successfully from my phone to the target phone. A message of length of 69 characters does successfully reach the destination phone. Any thoughts on carrier handling of USC-2 would be appreciated.


The Q9m has WM6 and the 2.0 compact framework. The code which replicates the problem is simple:

...
using Microsoft.WindowsMobile.PocketOutlook;
...
try{
SmsMessage sms = newSmsMessage();
sms.Body = "0123456789012345678901234567890123456789...[70 or more characters]";
sms.To.Add(newRecipient("15555551212"));
sms.Send();
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}

There are a number of unmanaged examples on the web that allow the explicit setting of the text message encoding (search for SMSDE_OPTIMAL). But I would like to avoid unmanaged code if possible.

Last edited by somuch; 04-25-2008 at 06:13 PM. Reason: clarify payload for sms.Body property
somuch is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


All times are GMT -5. The time now is 06:54 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
Integrated by BBpixel Team 2008 :: jvbPlugin R1015.37x.1