java - Bluetooth android server client with a headset -


i'm trying create server on android listen on incoming connections ,such specific headset have.

i've read many tutorials, posts in stackoverflow , 1 android|developer , , don't seem understand few things .

1) uuid , specific address each bluetooth device ? or shared key need in server , client in order create connection ? guess latter cause there mac address ...

2) when pair headset phone , headset saves mac\uuid of last paired device ?

3) bluetooth chips works in way ? phone connects paired device turned on, guess opens socket each paired device , waits turn on , true ?

4) possible accomplish im trying ? meaning creating bluetoothserversocket accept connection head set ?

code example server side:

//this may b needs uuid of headset ? or special 1 ? or ? uuid myuuid = uuid.fromstring("0000111e-0000-1000-8000-00805f9b34fb");  private final bluetoothserversocket mserversocket; private bluetoothadapter mbluetoothadapter = bluetoothadapter.getdefaultadapter(); tmp = mbluetoothadapter.listenusingrfcommwithservicerecord(activity.app_name, myuuid); mserverscooket = tmp; //im hoping block until specific headset turned on  socket = mserversocket.accept(); 

thanks in advance.

1) uuid ,is specific id bluetooth communication. when create bluetooth socket in android, listenusingrfcommwithservicerecord(activity.app_name, myuuid); ask android redirect bluetooth connection match uuid app.

2) i'm not sure. depends on type of connection headset can make. when want use it, need select in android, or can put , works ?

3) don't know. can have android source code ;)

4) if bluetooth headset can create connect socket, yes, possible

hope helps ;)


Comments

Popular posts from this blog

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -