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. Authenticating apps sending intents on the receiving en


I'm new to android and currently trying to write two simple
applications: a client and a server.
The client sends a hello in an intent (startactivity_for_result) to
which the server responds with a message.
Is there a way for the server to reliably check from the received
intent that the intent was indeed sent by my client and not by some
other application on the phone? I tried different methods, for
instance, to get the package name of the client sending the intent
(since the package name is known to me), but couldn't get this info
from the intent.

particular intent was granted the necessary permission by Android.
There is nothing about the "identity" of the intent sending app.

Is there way to authenticate the apps sending intents at the handling


2. AndroidGroup: Nested Actvities


I'm trying to create an application with an persistent "menu" at the
bottom for displaying different Activites. Think of it like a custom
tabbed layout. I need the applications to be stand alone so using
views won't work (unless I've missed something).

I've created a main window using a FrameLayout and a Linearlayout to
hold menu items. But whenever I start an Activity inside the
FrameLayout it takes all the focus and no interaction can be done with
the items inside the LinearLayout.

Any suggestions on how to accomplish this type of behavior?



3. Making Video files Android ready for playback over HTTP

4. OOT: Pak Gunaris Mengudara di Radio JJFM

5. 2.2 SDK refresh

6. Bisa diupgrade lagi ngak spicanya

7. question about the Android Git source tree Category