does someone know how to receive a file on android via RFCOMM? I'm a newby to bluetooth issues, so please have patience with me.
I'm looking for an approach to receive data via RFCOMM as a stream and store it somewhere on my phone. Saving data is not the problem, it works quite fine.
The main issue is the implementation of the connection and the reliable retrieval of the data...
This whole procedure should be implemented as an android service (so that no activity has to be launched while receiving data). What would you suggest: Local or remote service?
greetz, poeschlorn
In General:
The transport layer is the key, and the tricky part. It can be as simple as rolling your own. For example:
Sender sends: [Start of stream] | FILENAME | ATTRIBUTES | [binary data] [End Of stream]
Receiver sees the file name and attributes, saves them, and opens up an output file and starts writing from after attributes, to the end of the stream.
After the transfer is complete, close the input/output streams, and then close the socket.