Android Question Send SMS Problem

Discussion in 'Android Questions' started by domcoz, Mar 23, 2015.

  1. domcoz

    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
     
  2. Troberg

    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.
     
  3. Troberg

    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 likes this.
  4. Beja

    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.
     
  5. Troberg

    Troberg Well-Known Member Licensed User

    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.
     
  6. domcoz

    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
     
  7. GCOINC

    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...
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice