Android Question Send SMS Problem

domcoz

Member
Licensed User
I have this Code:

.....
Dim SmsOk As PhoneSms
Dim i As Int

Pb.Progress = 0

For i = 1 To 10
Dim cells() As String
cells = List1.get(i)

Pb.Progress = i/List1.Size * 100

txtNominativo.Text = cells(0) & " Cell. (" & cells(1) & ")"

'SmsOk.Send2(cells(1),txtMSG.Text & "(" & i & ")",False,False) '<- Op 1
SmsOk.Send(cells(1),txtMSG.Text & "(" & i & ")") ' <- Op 2

Wait(200)

Log(cells(1) & " -- " & txtMSG.Text & "(" & i & ")")
DoEvents
Next

....

No send all 10 sms es. send 1,2,3,4,5,6,10 non send 7,8,9

I try with Op 1 and Op 2

Thanks
Domenico
 

Troberg

Well-Known Member
Licensed User
My guess: You are sending them too fast, and something gets choked. Just for testing, try to wait longer, say, 60 seconds, between each SMS. If that works, you know the cause, and can start trying to find the sweet spot for the waiting time.

Also, if they contain the same text, consider trying to send it as one SMS with multiple recipients.
 

Troberg

Well-Known Member
Licensed User
Or, even better, use Send2, which gives you an event when a message is sent. THat way, you can tick out the messages at an optimum pace.
 

Beja

Expert
Licensed User
I see you have commented the right line: 'SmsOk.Send2(cells(1),txtMSG.Text & "(" & i & ")",False,False) '<- Op 1 (why)?
as Troberg advised, un-comment that and set the return value to true, instead of false.
 

Troberg

Well-Known Member
Licensed User
I see you have commented the right line: 'SmsOk.Send2(cells(1),txtMSG.Text & "(" & i & ")",False,False) '<- Op 1 (why)?
as Troberg advised, un-comment that and set the return value to true, instead of false.
And then change the logic to an event based one. Just add the messages to a list, and on each event, send the next one in the list and remove it from the list.
 

domcoz

Member
Licensed User
Thanks,

My goal and send the usual message to a set of contacts, for example birthday wishes or other. There is commented because i try both solution but I lost some sms.

Now I try change parameter false to true.

Domenico
 
G

GCOINC

Guest
FYI most providers have a 100 msg/per hr max, exceeding the provider limit throws a 'flag' to the provider for that device...
 
Top