0

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!

Meet
  • 4,904
  • 3
  • 24
  • 39
reznic
  • 281
  • 1
  • 3
  • 5
  • I think you use leJOS to develop your application onto the NXT. So, see that : http://lejos.sourceforge.net/nxt/nxj/tutorial/Communications/Communications.htm – Guillaume Jun 24 '12 at 13:33

4 Answers4

0

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.

Parth Doshi
  • 4,200
  • 15
  • 79
  • 129
0

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

trichner
  • 840
  • 1
  • 11
  • 22
0

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).

Luke Taylor
  • 9,481
  • 13
  • 41
  • 73
0

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:)

Sven Menschner
  • 603
  • 5
  • 12