Skip to main content

Problem Receiving data with Bluetooth Connection (Too slow) ¿Any idea?

1 reply [Last post]
xphree
Offline
Joined: 2007-04-11
Points: 0

Hello,

I have the next scenario:

- A device transmiting (via Bluetooth) information: frames of 112 bytes each one containing 56 ECG signal data.
- A mobile phone that receives the signal with an StreamConnection an a InputStreamReader, processing the data and painting in a Canvas.. the code of receiving is something like the next:

http://pastebin.com/f299d7fef

But the problem is that the transmissión is SO SLOW and the painting of the signal is taking a long time to paint.. i think that the reader.read(buffer) is taking more time than expected.. is there a way to receive the signal in a better and efficient way? is there a tip about the BUFFER size? override the InputStream Class? a better method to achieve more speed in the transmission?

Thank you for any help or idea about this,

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
xphree
Offline
Joined: 2007-04-11
Points: 0

The problem wasn't the reception, the problem was the way i paint in the canvas. i Was painting 1 by 1, when i changed the method on painting > 100 by 1 the reception was faster.

Thanks anyway :)