I am developing an application connecting a PC with Android based device over bluetooth, I have established the connection and implemented most of my project ideas.
However, I would like to add streaming functionality from the PC to the device, I don’t have any code yet as I am still in the planning stage! So I would like to ask for any helpful resources or tutorials? anything helpful as a first step?
I have implemented the PC side where I basically get the stream frames in the form of byte array, to be sent to the Android side…
Any help would be highly appreciated
The simplest way we could find was to actually implement a simple protocol for the transfer.
We compressed the individual frames, divided them into packets at the PC side, added a header for each packet, and a header packet for the entire frame, containing the total length of the frame and number of packets.
At the android side, we ran two nested loops, one for the frames of the stream, and one for the packets of individual packets. We used the data from the first packet of the frame to figure out the length of the loop and when to break, after we get the total frame size (verified by the first packet) we sent the total bytearray into a function converting the array into jpg immage, and used a canvas to continuesly showing the frames…
we got about two frames per second, which was good enough for bluetooth…