Android Bluetooth COM port -


i have spent time researching android's ability communicate bluetooth devices designed communicate on bluetooth com port on pc. haven't been able find definitive answer, thought i'd ask here. want make sure possible android.

i new bluetooth communications, research i've done far lead me rfcomm sounded wanted. unfortunately, i'm still unable confirm in fact possible.

any help/resources on appreciated.

yes, android can connect bluetooth com ports on pc's. developing such application. here code example (ite requires bluetooth permissions te set in manifest.xml file):

<uses-permission android:name="android.permission.bluetooth" /> 

java:

bluetoothadapter adapter = bluetoothadapter.getdefaultadapter(); if (adapter == null) {     // device not support bluetooth     finish(); //exit }  if (!adapter.isenabled()) { //make sure device's bluetooth enabled     intent enablebluetooth = new intent(bluetoothadapter.action_request_enable);     startactivityforresult(enablebluetooth, request_enable_bt); }  final uuid serial_uuid = uuid.fromstring("00001101-0000-1000-8000-00805f9b34fb"); //uuid serial connection mac = "00:15:83:3d:0a:57"; //my laptop's mac adress device = adapter.getremotedevice(mac); //get remote device mac, assume these 2 devices paired    // bluetoothsocket connect given bluetoothdevice bluetoothsocket socket = null; outputstream out = null; try {     socket = device.createrfcommsockettoservicerecord(serial_uuid);  } catch (ioexception e) {}  try {                socket.connect();      out = socket.getoutputstream();     //now can use out send output via out.write } catch (ioexception e) {} 

Comments

Popular posts from this blog

c++ - Is it possible to compile a VST on linux? -

java - Output of Eclipse is rubbish -

jquery - Confused with JSON data and normal data in Django ajax request -