non-chat bluetooth example

by Affan » Sat, 17 Jul 2010 02:27:41 GMT


Sponsored Links
 I need to send and receive data from an Android client to a Bluetooth
SPP server on a non-android platform (not decided, but possibly
Arduino with C code).

I am mostly trying to correctly read from the serial iostream provided
by the bluetooth socket and convert that into a Java class (to use as
a structure). while packaging a delimted byte stream is easy, I am not
quite sure about the serial io reading from the io stream (i.e. is
there a maximum byte size it will read? does it split the file sent
from the serial port and i have to manually combine later?).

Now, bit shifting and using something like ByteStream can make it
work, I was wondering if there is a serialization or mashalling stub
code that is already available on Android. Furthermore, the received
(at android) structure can have variable size strings, so
serialization becomes an even greater challenge, if done manually.

An example code doing non-chat (or string based) comms over bluetooth
in SPP (serial port profile) in android would be perfect (some sort of
protocol frames that are exchanged). I have googled this , but either
my google-fu has gone bad, or there just isnt any such example at the
top of search lists.

--



Other Threads

1. need subscription

--~--~---------~--~----~------------~-------~--~----~

2. emulator segmentation fault on Mac

Thanks to "Nathan" for his reply in a different post about working
around the emulator segmentation fault on a Mac when running with a
Plantronics USB headset,

Mike's Mac:tools mike$ emulator &
Mike's Mac:tools mike$ 2008-12-10 21:39:26.352 emulator[3235:10b]
Warning once: This application, or a library it uses, is using
NSQuickDrawView, which has been deprecated. Apps should cease use of
QuickDraw and move to Quartz.

Followed by a segmentation fault in the emulator.

Nathan unplugged his USB headset. I just wanted to mention that you
can also change your sound settings to use the internal audio devices
(my usb connections are a little harder to get to).



--~--~---------~--~----~------------~-------~--~----~

3. Emulator file path?

4. Is there a default proxy/firewall on the emulator?

5. Thread Allocation Question

6. Where do i start?

7. Crop Image Problem