On 03/16/2012 05:03 AM, Philipp von Weitershausen wrote:
> Thanks for bringing this up, Vicamo!
>
> On Wed, Mar 14, 2012 at 8:26 PM, Vicamo Yang <
vic...@gmail.com> wrote:
>> Per discussion in
>>
https://bugzilla.mozilla.org/show_bug.cgi?id=712933#c39 , an ordinary
>> SMS app might have some of following numbers on screen:
>>
>> 1) Total segments to send: as what this API originally means.
>> 2) Chars available per segment: depending on data code scheme, this
>> might be 140/70. It might also vary with concatenation involved.
>> 3) Chars already input in current segment.
>> 4) Chars remains available in current segment.
>>
>> iPhone gets "4)/2)", while Android gets "4)/1)".
In packages/apps/Mms/src/com/android/mms/ui/ComposeMessageActivity.java:
private void updateCounter(CharSequence text, ...) {
...
int[] params = SmsMessage.calculateLength(text, false);
/* SmsMessage.calculateLength returns an int[4] with:
* int[0] being the number of SMS's required,
* int[1] the number of code units used,
* int[2] is the number of code units remaining until the next message.
* int[3] is the encoding type that should be used for the message.
*/
...
}
The mapping of their meanings to items listed in my last post is int[0]
=> 1), int[1] => 3), int[2] => 4), int[3] => 2).
SmsManager.divideMessage() is only used at sending messages out.
>> BTW, all of the four numbers mentioned above are already available
>> in current implementation.
> We should see if we can squeeze the same amount of information out of
> the Android backend. We could declare some of those values optional. I
> know Mounir doesn't want to make the Android backend a second class
> citizen, but that shouldn't hold us back from being able to implement
> an even better experience with the Gonk backend.
Since SmsMessage.calculateLength() is public to Mms application, I think
extending this API won't raise such concern in the Android backend.
> Vicamo, do you have a suggestion for modifying the navigator.mozSms
> API to provide as much of (1)..(4) as possible?
To be compatible with Android backend, values other than the four
provided by original Android API should be avoid as possible. I don't
really know what will UI people say, but the four items cover even
iPhone sms UI design. So I think these four values will be enough for
everyone :P
Vicamo