Amir7741
New Member
Hello guys
I'm very beginner on B4A .
im try to communication between my phone (huawei G-700) and on serial <-> bluetooth module (HC05)
i have one problem when receiving data. the phone connect to BT module , but when receive data happen ,all things come to wrong , may phone's bluetooth isnt responding to anythings. need to restart the phone.
Help me PLS
I'm very beginner on B4A .
im try to communication between my phone (huawei G-700) and on serial <-> bluetooth module (HC05)
i have one problem when receiving data. the phone connect to BT module , but when receive data happen ,all things come to wrong , may phone's bluetooth isnt responding to anythings. need to restart the phone.
Help me PLS
B4X:
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
Activity.LoadLayout("1")
If FirstTime Then
ser.Initialize("Serial1")
Timer1.Initialize("Timer1", 300)
End If
End Sub
Sub Activity_Resume
If ser.IsEnabled = False Then
Msgbox("Please enable Bluetooth.", "")
Else
ser.Listen 'listen for incoming connections
End If
End Sub
B4X:
Sub Timer1_Tick
Dim in_str As String
If connected Then
If TextReader1.Ready Then
in_str=TextReader1.ReadLine
Do While in_str <> Null
Label1.Text=in_str
in_str=TextReader1.ReadLine
Loop
End If
End If
End Sub