agro6162 / talkmyphone

Automatically exported from code.google.com/p/talkmyphone
0 stars 0 forks source link

[Fixed in GTalkSMS] Long SMS #30

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Connect TMP
2. Send a long sms to yourself (more than 160 chars)
3. Watch how you receive them

What is the expected output? What do you see instead?
It would be normal to get one long SMS, instead of multiple short one.
I know SMS don't allow for long SMS, but there is a way to chain them for the 
receiver to ignrore this technical issue.

Also note that sent sms (longer than 160) are duplicated in the outbox, but in 
full. This i guess is more easily fixable.

Original issue reported on code.google.com by neam...@gmail.com on 18 Sep 2010 at 12:02

GoogleCodeExporter commented 9 years ago
I can confirm the beginning of the issue, but I don't see what your last point 
about the outbox means.

Original comment by chm.duquesne on 19 Sep 2010 at 8:26

GoogleCodeExporter commented 9 years ago
When you send a long sms, it is appended in full multiple time in the sms 
outbox.

En français, je réussirais peut-être mieux... quand on envoie un SMS, il 
apparaît bien dans les messages envoyés de l'application SMS. S'il est trop 
gros (>160 caractères), il est coupé à l'envoi mais pas à l'ajout dans les 
messages envoyés : il y a donc plusieurs fois le même gros message à la fois 
dans les archives, ce qui ne facilite pas forcément leur consultation.
Pour tester : envoyer un gros message (genre 5-6 sms) à quelqu'un, puis 
regarder dans l'application la façon dont ils ont été enregistrés. Mais il 
s'agit en fait de deux "issues" distinctes !

Original comment by neam...@gmail.com on 19 Sep 2010 at 8:56

GoogleCodeExporter commented 9 years ago
Ok, I get it. 

Well, the top priority is not on this right now, because there are bugs that 
are more annoying, but this one will be fixed.

Original comment by chm.duquesne on 19 Sep 2010 at 9:23

GoogleCodeExporter commented 9 years ago
Issue 66 has been merged into this issue.

Original comment by chm.duquesne on 6 Oct 2010 at 1:37

GoogleCodeExporter commented 9 years ago
This is a very obvious (annoying) bug with a very simple code fix. 

The method that sends SMSes splits them up, then loops through each part, and 
sends a separate SMS for each part (why?!). Furthermore, for a reason unknown, 
in each iteration of the loop the *FULL* SMS is added to your phone's sent 
items. This is why you get duplicates.

The SmsManager class has a method to send a multipart SMS, passing it an 
ArrayList<String> containing the parts (as returned by the method that splits 
them up) so I don't know why the author decided to completely ignore this 
feature and use the basic SMS sending method instead.

Original comment by sea...@gmail.com on 7 Oct 2010 at 9:46

GoogleCodeExporter commented 9 years ago
Yeah, I'll fix that. My only problem is when I do that it messes up the 
emulator. Maybe it does not do that on real phones...

Original comment by chm.duquesne on 7 Oct 2010 at 9:53

GoogleCodeExporter commented 9 years ago
@chm.duquesne That's a known bug in the emulator, multipart sms works well on 
devices though: http://code.google.com/p/android/issues/detail?id=3539

Original comment by erikdeno...@gmail.com on 7 Oct 2010 at 10:57

GoogleCodeExporter commented 9 years ago
Why are you using telephony.gsm.SmsManager anyway, it's deprecated? 
telephony.SmsManager supports GSM and CDMA.

Original comment by anonym1970 on 7 Oct 2010 at 11:47

GoogleCodeExporter commented 9 years ago
Because I aim at supporting every phones starting from 1.5. (I personally have 
an old android phone).

Original comment by chm.duquesne on 7 Oct 2010 at 11:54

GoogleCodeExporter commented 9 years ago
can be easily done with the sms divide or send multi part msg 

Original comment by atlrudeb...@gmail.com on 7 Oct 2010 at 10:35

GoogleCodeExporter commented 9 years ago
There is the patch for this purpose : in revision a4320279b9e9 (before drastic 
changes of talkmyphone core (i.e. Beta 2.06)) change sendSMSByPhoneNumber 
function from com.googlecode.talkmyphone.SmsMmsManager.java by :

public static void sendSMSByPhoneNumber(String message, String phoneNumber) {
        //send("Sending sms to " + getContactName(phoneNumber));
        SmsManager sms = SmsManager.getDefault();
        ArrayList<String> messages = sms.divideMessage(message);

        //création des liste d'instents
        ArrayList<PendingIntent> listOfSentIntents = new ArrayList<PendingIntent>();
        listOfSentIntents.add(sentPI);
        ArrayList<PendingIntent> listOfdelIntents = new ArrayList<PendingIntent>();
        listOfdelIntents.add(deliveredPI);
        for (int i=1; i < messages.size(); i++){
            listOfSentIntents.add(null);
            listOfdelIntents.add(null);
        }        

        sms.sendMultipartTextMessage(phoneNumber, null, messages, listOfSentIntents, listOfdelIntents);

        addSmsToSentBox(message, phoneNumber);
    }

This will send the long sms in a multipart manner, add only one instance in the 
outbox, and display only one notification for "message sent" and "delivered"

And it should work from Android 1.5 ...
Regards,

Y.

Original comment by yoanjacq...@gmail.com on 2 Dec 2010 at 2:56

GoogleCodeExporter commented 9 years ago
Fix with yoanjacquemin solution.

The project has migrate at http://code.google.com/p/gtalksms

Original comment by Florent....@gmail.com on 11 Dec 2010 at 11:39