Need bluetooth to remember and auto connect when app starts

1,514 views
Skip to first unread message

Randy Fisher

unread,
May 4, 2016, 9:28:49 PM5/4/16
to MIT App Inventor Forum
I have an application that uses the list picker to select a bluetooth device. I would like to remember the bluetooth device, and automatically connect the bluetooth device either when it comes into range or the application is started. Any ideas on how I could do this? I suspect the the TinyDB will be needed.

Taifun

unread,
May 4, 2016, 9:38:41 PM5/4/16
to MIT App Inventor Forum
yes, exactly
TinyDB tutorial by Stephen

A very good way to learn App Inventor is to read the free Inventor's Manual here in the AI2 free online eBook   http://www.appinventor.org/book2 ... the links are at the bottom of the Web page.  The book 'teaches' users how to program with AI2 blocks.
There is a free programming course here http://www.appinventor.org/content/CourseInABox/Intro  and the aia files for the projects in the book are here:  http://www.appinventor.org/bookFiles  
How to do a lot of basic things with App Inventor are described here:  http://www.appinventor.org/content/howDoYou/eventHandling  .

Also do the tutorials http://appinventor.mit.edu/explore/ai2/tutorials.html to learn the basics of App Inventor, then try something and follow the
 Top 5 Tips: How to learn  App Inventor

You will not find a tutorial, which does exactly what you are looking for. But doing the tutorials (not only reading a little bit) help you to understand, how things are working. This is important and this is the first step to do.

Taifun

Trying to push the limits of App Inventor! Snippets and Tutorials from Pura Vida Apps by  Taifun.         



Martyn_HK

unread,
May 8, 2016, 7:38:16 AM5/8/16
to MIT App Inventor Forum
For auto connect when the app starts, have a look at Android MIT App Inventor – Auto Connect To Bluetooth.

Connecting when it comes in to range is a different matter. 
If Bluetooth is already connected the connection should be maintained when the module is moved out of range and back again. At least this happens for me using a Samsung device and also a Sony device.
I don't think auto-connecting when in range, when no connection exists, is possible with AI2.
 



Reply all
Reply to author
Forward
0 new messages