Android Tutorial [B4XPages] Bluetooth Chat Example

Erel

Administrator
Staff member
Licensed User

Attachments

Last edited:

rraswisak

Active Member
Licensed User
I download the sample project and run on Redmi Note 8 Pro without any modification, but always getting error while starting discovery.

So, for those with android 10 and found Error starting discovery process just turn Location ON.
Now the sample project run as expected.
 
Last edited:

John W. Miescher

Member
Licensed User
Dear Erel,
I just downloaded you Pages Chat program which should be very helpful in learning how to connect to bluetooth devices.
In fact it discovers other devices, but when clicking on them (pairing) I get this error:

java.io.IOException: read failed, socket might closed or timeout, read ret: -1

what have I missed or done wrong?

Thanks for your help and best regards,

john m.
 

John W. Miescher

Member
Licensed User
You can only connect to other devices that listen for SPP connections. Run this app on two devices for this to work.
Great, thank you Erel.
But how can I chat with my girlfriend who uses an iPhone and what are the alternatives to SPP?
In fact what I really want is to read data from my kitchen scale.
Do you have a tutorial video on this and where would I find an example?
Thanks,
john m.
 

Beja

Expert
Licensed User
Example updated with targetSdkVersion = 29. The fine location permission is required now.
Hi Erel,
Thanks and I didn't run it yet, but just wondering why is the location required!!
 
Top