2017년 1월 11일 수요일

Dedicated bluetooth connection?


In nearly all of the bluetooth apps made in the gallery, I noticed that:

1) Once you turn on bluetooth on your Android phone/tablet, you need to link up with some sort of bluetooth device (Arduino or other). Once connected, it is there for life. But then...
2) When you open any bt app created in MIT App Inventor2, you then have to go to a "select screen" inside the appto once again select the bluetooth device you wish to link up with... something you just did!

Is there a way to dedicate a bluetooth device, without having to choose it multiple times?

--
see screenshot: instead of the listpicker use the Screen.Initialize event to connect the devices using the MAC address instead of listpicker.selection

-- 
Awesome, and thank you!!! 

I feel like I am asking much here, but now you have me wondering... since it is possible to alter the name of the bluetooth device, would it be possible to link up via that, instead of a mac address?

-- 
no, see also the documentation http://ai2.appinventor.mit.edu/reference/components/connectivity.html#BluetoothClient


boolean Connect(text address)
Connect to the Bluetooth device with the specified address and the Serial Port Profile (SPP). Returns true if the connection was successful.

--
Ah well, had to check.

Thank you for your help, friend. Much appreciated!!!

-- 


댓글 없음:

댓글 쓰기