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. Nexus GPS antenna is always active when "Use GPS Satellites" is checked...

Does this mean there's a bug in the browser which keeps GPS active
when it isn't needed?

Matt











> 

2. Launch ContextMenu from ContextMenu

How can I launch a contextmenu from a contextmenu?

I'm trying to replicate the MediaPlayer action that happens when you
long click a song, then click "Add to playlist" in the resulting
contextmenu. When you click that menu item, another contextmenu pops
up with "Add to playlist" as the title, and "Current playlist", "New",
and however-many-playlists-you-have defined after that.

Ken

-- 

3. How to increase FPS (now ~20, desired ~40-50)

4. no sound from music players even when alsa is fully functional

5. Problem while sending unicode character via SMS

6. Notification sound from file inside the app package ?

7. Timer and Timer Task