Android Question Bluetooth delay between sending from other device and receiving in APP

petr4ppc

Well-Known Member
Licensed User
Longtime User
Dear friends,

please, I have this situation:

I.) Android APP with A) device
1) I am using service for receiving data via Bluetooth
2) I am using in service this settings:
B4X:
AStream.Initialize(Main.Ser1.InputStream, Main.Ser1.OutputStream, "AStream")

II.) then if I send data from device B) to device A)
Data are simple. Only for example "HALLO"

Then in moment I see in Logs, first
** Activity (main) Pause, UserClosed = false **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
** Activity (main) Resume **

and then after 1 second I am receiving data
"HALLO"

But it take 1 or 1,5 second between sending and receiving data...it is too much

Please, where is trouble? I must get shorter time between sending and receiving data and I need use service for receiving seriál data.
 

petr4ppc

Well-Known Member
Licensed User
Longtime User
Thank you very much Erel for your help.

I will try another devices.

But I know, that "HALLO" is received immediately, because in LOG I immedaitely see this:
** Activity (main) Pause, UserClosed = false **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
** Activity (main) Resume **

And after 1,5 second I get "HELLO".
Delay exist because of Activity go to PAUSE and RESUME mode....

Can I have something wrong with calling functions in MAIN?
If I have in service this?
Realy here can not be trouble?
B4X:
AStream.Initialize(Main.Ser1.InputStream, Main.Ser1.OutputStream, "AStream")

Thank you very much
Best regards

p4ppc
 
Upvote 0
Top