B4J Question Reading GSM modem crashes app

Beja

Expert
Licensed User
Longtime User
Hi all,
I am using a GSM modem and a friend of mine is helping me with the solution... but he doesn't have the modem
so he couldn't test it.. in my side, when I click the Read GSM button the system crashes or hangs for a very
long time before telling it's not responding!!
Please see the code below and I would appreciate any explanation!

B4X:
Sub btnRead_Action
         'Read string from GSM modem
          Dim iStream As InputStream
          iStream = sp.GetInputStream
         Dim buffer() As Byte
         Dim count As Int = iStream.ReadBytes(buffer,0,buffer.Length)
         TextArea1.text = BytesToString(buffer,0,buffer.Length,"UTF-8")
End Sub
 

Beja

Expert
Licensed User
Longtime User
I tried to follow your previous advice to use getinputstream and never use asyncstreams.. will check this again and see what did I miss.
 
Upvote 0
Top