I am developing an Android application which needs an image to be transmitted from one android device to another via bluetooth.The image size goes upto 3 to 4 MB.The problem I am facing is that when i send the image in form of bytes, the image is received in parts not in single stretch. For eg i transferred an image whose length after converting to bytes was aroung 64k but at the receiving end it was received in batch of 1024.How to successfully transfer the image?
Is there any efficient way to transfer the image?
Am I doing it the right way or not?
Any help will be appreciated.
OK atlast some how transmitted the image successfully:)Still I don't know why the images were transferred in batches.The problem was partially due to my buggy code,the buffer size was initialized only for 1024 bytes.That was one reason why it was transmitting in batch of 1024.I reinitialized buffer to a big value nonetheless the image was received in batches but batches of large size.Finally i collected them in batches and rearranged to form complete image.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With