Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

send/receive data via Bluetooth

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!

like image 901
SnelleJelle Avatar asked Feb 19 '15 15:02

SnelleJelle


People also ask

Which is used for sending data information through Bluetooth?

Bluetooth devices communicate using low-power radio waves on a frequency band between 2.400 GHz and 2.483.


Video Answer


1 Answers

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

like image 191
Kasra Avatar answered Sep 29 '22 17:09

Kasra