I looked at the
FBTClickLinkCompete<http://code.google.com/p/apps-for-android/source/browse/#svn%2Ftrunk%2FBTClickLinkCompete>
'source,
for (int i = 0; i < Connection.MAX_SUPPORTED && myBSock == null; i++) {
for (int j = 0; j < 3 && myBSock == null; j++) {
myBSock = getConnectedSocket(myBtServer, mUuid.get(i));
if (myBSock == null) {
try {
Thread.sleep(200);
} catch (InterruptedException e) {
Log.e(TAG, "InterruptedException in connect",
e);
}
}
}
}
This code fragment shows a client that trys to connect the server... The
sample of SDK(BluetoothChat) used same code except
for (int i = 0; i < Connection.MAX_SUPPORTED && myBSock == null; i++) {
for (int j = 0; j < 3 && myBSock == null; j++) { ....
I don't understand why? what'more, it can't connect to multiple devices *at
the same time*!
Thanks!!!
2010/12/21 Morrison Chang <[email protected]>
> Look at http://code.google.com/p/apps-for-android/
> Specifically the code for BTClickLinkCompete for a sample of Bluetooth
> connectivity.
>
> http://code.google.com/p/apps-for-android/source/browse/#svn%2Ftrunk%2FBTClickLinkCompete
>
> I think the air hockey sample supports 4 other devices along with the
> server device.
>
> -Morrison
>
> On Dec 20, 3:37 am, 苗鹏 <[email protected]> wrote:
> > could you share me your code?Thanks!
> >
> > 2010/12/20 James <[email protected]>
> >
> >
> >
> >
> >
> >
> >
> > > of course you can,
> >
> > > On Dec 18, 9:25 am, 苗鹏 <[email protected]> wrote:
> > > > It is possible to connect simultaneously to multiple bluetooth
> devices?
> >
> > > --
> > > You received this message because you are subscribed to the Google
> > > Groups "Android Developers" group.
> > > To post to this group, send email to
> [email protected]
> > > To unsubscribe from this group, send email to
> > > [email protected]<android-developers%[email protected]><android-developers%2Bunsubs
> [email protected]>
> > > For more options, visit this group at
> > >http://groups.google.com/group/android-developers?hl=en
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]<android-developers%[email protected]>
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en