7

I'm trying to send/receive a string from an android device. I've been googling for the last 3 hours and I can't find anything that just works. the closest I got was this: fella

and I get these errors:

02-19 15:44:17.680    4680-4680/com.example.jelle.bluetoothconnector W/System.err﹕ at com.example.jelle.bluetoothconnector.BluetoothConnection.init(BluetoothConnection.java:38)
02-19 15:44:17.680    4680-4680/com.example.jelle.bluetoothconnector W/System.err﹕ at com.example.jelle.bluetoothconnector.BluetoothConnection.<init>(BluetoothConnection.java:25)
02-19 15:44:17.680    4680-4680/com.example.jelle.bluetoothconnector W/System.err﹕ at com.example.jelle.bluetoothconnector.ConnectorActivity.btnBluetooth_onCLick(ConnectorActivity.java:92)
02-19 15:44:17.680    4680-4680/com.example.jelle.bluetoothconnector W/System.err﹕ at java.lang.reflect.Method.invoke(Native Method)
02-19 15:44:17.680    4680-4680/com.example.jelle.bluetoothconnector W/System.err﹕ at java.lang.reflect.Method.invoke(Method.java:372)

can anyone help me? I just need some code that can send/receive a string via bluetooth to get me started

Thanks!

Community
  • 1
  • 1
SnelleJelle
  • 933
  • 5
  • 18
  • 35

1 Answers1

5

The best and most comprehensive example is Android's official bluetooth chat example. You probably do not need to change most of the stuff. See this: https://github.com/googlesamples/android-BluetoothChat

Kasra
  • 3,045
  • 3
  • 17
  • 34