Android Question bluetooth example on two android devices

dara hayes

Member
Licensed User
Longtime User
I have been spending the last two weeks reading the Bluetooth software examples and trying them out on my target device a 7 inch Asus Tablet (ME173X) running android 4.2.2 and I am using as a second Bluetooth coms device for test purposes only , a Sony Xperia Z phone running android 4.3 however the Bluetooth example does not work correctly both ways .

My main and first problem was the B4A IDE Bluetooth connect does not and will not work with the Asus Tablet despite installing 2.09 B4A bridge program and setting the device to listen however one gets an immediate error saying make sure the B4A bridge device is set to Listen , it connects without problem each time to the Sony Xperia (4.3) and when the both devices have the example program loaded the tablet by usb cable and the Xperia by bluetooth , when the Tablet trys to connect to the Xperia it connects and goes to the chat activity screen but the Xperia does not switch screen , pressing a few chars in the send box and pressing send on the tablet usually results in connection broken on the Tablet , or pressing return key to exit the chat screen does not as it should show broken connection on the Xperia device , however when the connection is reversed by connecting from the Xperia to the Tablet the example program runs fine both ends switch to Chat screen and the link is solid both ways forever or until one device switches out of Chat screen, is this down to Android Versions or could some one please let me know what may be wrong with my Asus Tablet !
 

derez

Expert
Licensed User
Longtime User
Reading your post I went to check my Asus TF101 in bluetooth.
Here are the results:
1. Connection between Tablet and device using BT works both sides but only after both sides present a dialog box for pairing, asking to approve a password (which is sent from the Asus Tablet).
Connection with PC with Bridge - the tablet shows a message saying that the other side should approve the password but the PC does not show the dialog and does not connect.
Seems like a special security means by Asus...
 
Upvote 0

dara hayes

Member
Licensed User
Longtime User
Thanks for both your replies I will try Erel's suggestion and see IF I can get round this issue with a different connection type in code , however
is there some way I can pick up this security password passing from the Asus in my b4a code with the standard tools we have at our disposal in the Serial / Bluetooth library's
 
Upvote 0

dara hayes

Member
Licensed User
Longtime User
the different connection mode requires use of a port and I don't know enough about Bluetooth to even guess what port number I select and I dont understand why the Asus wont connect outward but will when the Sony starts the connection , surely that is an inward bluetooth connection request to the Asus and the Asus accepts it and the example prog works every time , it seems its outward bound connections wont work to the Sony , the Asus goes int chat mode so it must be getting some form of connection acceptance trigger , but the Sony doesn't go into chat mode , it wont connect yet the B4A ide cant connect inward to the Asus , I am mighty confused
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…