问题
For a fest at my college, we are planning a quiz contest.
For the buzzer round, I was thinking of writing 2 app for android (we have a few handsets), one for the quiz master and the other for the contestants
The contestants will be connected to the quiz master through bluetooth.
After reading the question, the quiz-master clicks a button in his/her app, the button in the contestant apps will be enabled for X seconds. As soon as a contestant clicks his/her button, the quiz master's app will flash the name of that contestant.
My questions:
Is it even possible to have multiple connections and accept concurrent (or multiplexed) messages from them in bluetooth (something similar to select() in unix/c)?
If possible, where should I look for any examples? What kind of problems will I face trying to develop this (I know reliability is an issue here) and how to avoid them?
I had tried this on laptops before and failed. But maybe I gave-up very early. Please help.
EDIT:
I gave-up the project (too many connection drops). I'm keeping the question open though.
回答1:
Bluetooth supports piconets, in which a single (quiz) master can communicate with up to 7 slaves.
So, at the Bluetooth level, this should be doable. I'm not the person to say if it's possible to implement using Android's Bluetooth API:s, though.
回答2:
Have you read though this and the rest of the information available specifically for Android? http://developer.android.com/guide/topics/wireless/bluetooth.html
Aside: When I was in college we did trivia nights the old fashioned way (paper and pencil) but on the plus side you didn't have to worry about having expensive phone handsets in the hands of drunken college students! ;-)
来源:https://stackoverflow.com/questions/3707690/bluetooth-concurrent-connections