Android Question Bluetooth chat example don't want to start

Status
Not open for further replies.

TomKluz

Active Member
Licensed User
Hello,

Hello,
I am trying to start Bluetooth Chat example which I took from this community, published by Mr Erel.
I only want to convert to AsyncStreamText class as I did in B4J. Unfortunatelly it didn't want work
I am trying to use this form:
AStream.Initialize(Me, "AStream", serial1.InputStream, serial1.OutputStream) but I am getting in a log panel a lot of red colour. I am attaching a screen shot about this.

May I ask for help in this case ?

TomKluz
 

Attachments

  • Log_B_Chat.jpg
    Log_B_Chat.jpg
    90.9 KB · Views: 206

TomKluz

Active Member
Licensed User
Thanks. I have many, probably mistake during innstalation.
This tread title is that Chat example don't want to start. Recently has started but don't want to stop. I can't finish it. Have been trying "ExitAplication", "'Activity.Finish" but no way to abandon it like in B4J.
Additionally reading text data after some time is locked and I am getting an info about some promlems with a socket.
Prerhaps to many data is coming ?

TomKluz
 
Upvote 0

OliverA

Expert
Licensed User
Longtime User
Additionally reading text data after some time is locked and I am getting an info about some promlems with a socket.
Without an error log posting, it's hard to see what is going on
Recently has started but don't want to stop. I can't finish it. Have been trying "ExitAplication"
Don't use ExitApplication. That will crash your App and Android will show an "Application has crashed" error message.
like in B4J.
An Android application is not like a B4J application where you are in control. Android is in control and may not completely shut down your app when you want it and at times shut down your app when you don't want it. Read about Android's application life cycle at the following post: https://www.b4x.com/android/forum/threads/android-process-and-activities-life-cycle.6487/#content. Read all links in the post and watch the video.
 
Upvote 0

TomKluz

Active Member
Licensed User
Hello,
Chat example starts to work under conditio what it is a first time. It is getting data in text format from remote Arduino device. Starts well but after several seconds slow down and finally comunication is blocked. I have to wait some minutes to be able to start this example and read data. Sometimes I am getting this foults in log panel:

Logger connected to: HTC HTC One A9s
--------- beginning of system
--------- beginning of main
** Activity (main) Create, isFirst = false **
** Activity (main) Resume **
Koniec
connected: false
java.io.IOException: read failed, socket might closed or timeout, read ret: -1
** Activity (main) Pause, UserClosed = true **
sending message to waiting queue (serial1_connected)
** Activity (main) Create, isFirst = false **
running waiting messages (1)
connected: false
java.io.IOException: read failed, socket might closed or timeout, read ret: -1
** Activity (main) Resume **
Koniec

Aditonally I can't start emulator. In IDE I have seen that I have to use HAXM driver for Intel CPU. May I install it safely ?

Kind regards
TomKluz
 
Upvote 0
Status
Not open for further replies.
Top