Android Question SendSms (bug?)

Marcos Alves

Well-Known Member
Licensed User
Longtime User
Hi @Erel ,

I´m getting a very strange bug using sendsms. When using the method send I noticed that some of my users crashed my app with some messages. I thought that could be any special character in message but after testing many characters I discovered that the character is not important: the combination between position, number of characters and message crashes the app!
I could sample a message which was crashing the app. That is:

nao estou de graça /: eu te acho muito linda só q eu sou envergonhado /:

I tested many hipothesys which could be generating the bug but couldn´t identify one. I think that log isn´t needed. Only do:

Ps.Send(phone,"nao estou de graça /: eu te acho muito linda só q eu sou envergonhado /: ")

and you app will crash!!! Can you help me? (for now, the only solution which I discovered was eliminate all special characters like "/" and ":" but I´m killing the sms emoticons (and this is not good...).

Please help.

Thanks!

Ps: Sorry, the sms message is in portuguese... :)
 

Beja

Expert
Licensed User
Longtime User
Hi Marcos,

Did you try splitting the sms msg and then send the combined message? This way you don't specify the whole
string but your code will do.
msg, a, b, c are string vars.

msg = a & b & c
Ps.send(msg)
b = "/"
c = ":"

I didn't try it..

my two cents!
 
Upvote 0

Marcos Alves

Well-Known Member
Licensed User
Longtime User
Hi @Beja !

Did you get the same error? I think so... very strange! Looks like some piece of characters in message is calling an internal java code and crashing... I tried to split in three messages and send (without remove any character!) - works!
I didn´t tried to join again and send... but I think that the question is: there is a "bug" in Sendsms call which for some combinations of characters crashes the program. The best solution is check the classes involved in this method and fix - because this message couldn´t be the only "crash reason"... I mean, if we don´t know for sure the reason, it´s possible to exist other combination of characteres which could do the same thing.

Thanks!
 
Upvote 0
Top