I searched the web a long time for a full Bluetooth communication example for android (eclipse) with another Bluetooth device. I found some codes but none of them workd. I'm developing app that will communicate with a lego mindstorms nxt. I will be glad if someone can show me a clear example of a full code with all the steps to perform Bluetooth communication from beginning to send and receive simple messages like numbers. Thank you very much!
4 Answers
Well you first need to go through some sample examples from the Android developers guide
Refer the developers page for Bluetooth Communication.
I found this that would help you start creating your application.

- 4,200
- 15
- 79
- 129
We did similar stuff, except with a microcontroller:
http://code.google.com/p/projectneo/
It's all OpenSource, just browse the code:
http://code.google.com/p/projectneo/source/browse/#svn%2FProjectNEO%2Fbranches%2Fv2
Look at BluetoothUtils
, SendService
, SendJob
and ReceiveJob

- 840
- 1
- 11
- 22
Here is working code: https://github.com/borismus/android-nxt
You'll find all you need to establish a connection and send data, I've also got another example that a fellow Mindstormer send to me (a project which use of the android compass sensor).

- 9,481
- 13
- 41
- 73
There is an example at the lejos site on sourceforge:
http://lejos.sourceforge.net/nxt/nxj/tutorial/Android/Android.htm
Unfortunately, the referred code must be downloaded somewhere else:
https://github.com/Shawn-in-Tokyo/leJOS-Droid
Important: This example was made fpr lejos 0.8, there were some changes in the API of version 0.9.x, which are quite simple to adapt. I got it running on leJos 0.9.1 but you could use 0.8 as well. Contact me if you could make it and how you did it:)

- 603
- 5
- 12