Serial Data Transfer via Bluetooth

by AnthonyB » Wed, 17 Mar 2010 04:18:43 GMT

Sponsored Links
 I'm trying to get serial data from a USB Weather Board from Sparkfun
Electronics using one of their SPP Bluetooth Modems.  This device will
be able to send serial data over bluetooth and all I wan't to do is
read and store the data.  I'm pretty sure this is possible but I'm
still not great at writing code for an android device yet. After that
I want to take that data and put it into a human-readable way for
instance for temperature have ("Temperature= 70F"). The value of 70
will come from the serial ascii string of bytes and I'll probably be
able to work with the data after I get it and save it.  So can anyone
give me a little bit of code on how to read and store the ascii string
or give me a good example to look at?  Also the string is 46 bytes and
starts with a # sign and ends with a $ sign and I'd like to use that
to make sure I just get one string of data.  Any help or insight would
be greatly appreciated.



Serial Data Transfer via Bluetooth

by DonFrench » Wed, 17 Mar 2010 09:27:06 GMT

 Look at the Bluetooth Chat example and change the UUID to
"00001101-0000-1000-8000-00805F9B34FB".  That should get you going.


Sponsored Links

Serial Data Transfer via Bluetooth

by BobG » Thu, 18 Mar 2010 03:05:43 GMT

 Hi Don. I think you need 2.0 or higher to run the bluetooth chat
example.. wish it wasnt so... I have a dev phone 2 (Google Ion? Does
it have other names? HTC something? TI something?) with 1.6. Someone
know how to use the bt backport examples? What dir do I put the jar
file in?


Serial Data Transfer via Bluetooth

by DonFrench » Thu, 18 Mar 2010 06:14:21 GMT

 Then we are out of my comfort zone.  You might check this site though,  According to 
Bonifaz Kaufmann, the developer of Amarino, they are communicating via
Bluetooth SPP with   the following devices, all pre 2.0.

    * HTC Dream (aka T-Mobile G1, firmware 1.1, 1.5 and 1.6)
    * HTC Magic (firmware 1.5 and 1.6)
    * HTC Tattoo (firmware 1.6)
    * Huawei U8220 (aka T-Mobile Pulse, firmware 1.5)
    * (partially tested) Samsung Galaxy (firmware 1.5)

You can find the entire source code of Amarino here: 
and it includes all the Bluetooth related stuff as well.  Good luck.


Serial Data Transfer via Bluetooth

by Ben » Fri, 19 Mar 2010 05:43:37 GMT

 I've attempted to use the unofficial Bluetooth API for 1.6, got
through finding the adapter and the remote device, but could not open
an RFCOMM socket.  You should be able to put the Jar anywhere as long
as Eclipse--if that is what you are developing on--points to it.
There are instructions on how to external libraries on the android
developer site: 

Though google advises against using these to future proof your app.


Serial Data Transfer via Bluetooth

by Lovers v. Haters » Fri, 19 Mar 2010 05:44:56 GMT

 I agree-- Amarino is pretty useful.  I'm doing a project that uses
Amarino to transmit strings of data over XMPP.  (Google put the kibosh
on making your own jabber client, but I found a useful JAR to get
around it.)  Put Amarino together with XMPP and your device becomes a
great transmitter for broadcasting microcontroler status anywhere

If you're interested in going that route, check out (in addition to
1) Asmack (Jabber hack for 1.5 and 1.6-- not sure about 2.0) 
2) ChatStar (which I wrote cobbling Amarino and Asmack together) 

Harlo/Lovers v. Haters


Serial Data Transfer via Bluetooth

by BobG » Sun, 21 Mar 2010 03:00:45 GMT

 Thanks Ben... your message was the clue I needed... I put the backport
jar file in a dir in the package, went to the package properties and
added the jar under 'link external jars', and the bt chat compiled
right up. Lots of details need to be right to get this stuff to work,


Serial Data Transfer via Bluetooth

by Ben » Sun, 21 Mar 2010 23:25:15 GMT

 No problem Bob.  Let me know if you are able to open an RFCOMM socket
it never worked for me.  I checked the Amarino source code, and it
looks like I am doing basically the same thing that they are, but for
some reason they can get it open and I can't.  So for now I've
modified my app to use a broadcast receiver to receive data from the
amarino like the examples.  Though I don't have my Bluetooth antenna
hooked up to an Arduino, it's hooked up to a Blackfin DSP, so
hopefully there is nothing about Amarino that actually requires the
thing on the other end of the UART to be an Arduino.  Looking through
the source I can't find anything that would limit it like that, but
I'll see.


Serial Data Transfer via Bluetooth

by Shane » Sat, 27 Mar 2010 04:57:15 GMT

 Hi guys,
Im new to android and im trying to use the bluetooth backport. Could
someone explain what the step "put in to your src directory. "
means? Do i create a file and paste in the code or is there something
im missing. Ive followed the other steps and its not working for me so
i think the problem lies here.



Other Threads

1. People u should follow

Brader mo infoin org2 yg gw follow di twitter...

jesusxxx_X ... want app crack? RT him, he will give u a direct link

cyanogen ... well u know him..
Amon_RA ... great Magic cooker
PaulOBrien ... Hero cooker (modaco)

l3wish ...
MuscleNerd ... fast news about iPhone unlock!

--- Sent with SEVEN on Android - the new generation of mobile messaging

Google Groups "Indonesian Android Community [id-android]" group.

To post to this group, send email to

To request to subscribe to this group, please visit the following page:

2. Disabling Contact Sync


So, I'm trying to figure out a way to disable Auto-Sync of the
Contacts database because there may be cases where my application
tries to write 1000 contacts to the database, which can take a very
long time.  I've noticed that some apps on the market have the ability
to disable syncing, but I can't find a way to do it.  I've noticed
that there are two permission:


but I can't find where these are used in the Android source code.  I
don't even need to disable gmail/calendar syncing, I just need to
disable Contact syncing.  Any help would be great.

Jonathan Herriott

3. Vertical TextView

4. Minta tutorial nge root htc magic bwt nubie dong master.

5. Why does getPadding() of NinePatchDrawable throw a NullPointerException?

6. barcodeScanner

7. Help! Trying to get Basic Auth working with WebView. setHttpAuthUsernamePassword?