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. Still trying to get my head around permissions - can anybody help?

Non-public APIs aren't mentioned in the sdk documentation. They may be
documented in the source code but suppressed from javadoc with @hide.


2. Android Tutorials

This is very interesting android application development

This is tutorials in this websites.


3. Is there a "dev tools" for real device?

4. Anyone else new to open source.

5. Determine notification bar height from a service

6. Using a ContentProvider with ItemizedOverlay?

7. Android on Data Collectors