I am developing an app in which I need to transfer data in file between two devices.
I have seen tutorial regarding Bluetooth chat but can't figure out what stuff needed for file transfer. How can I do this?
I am developing an app in which I need to transfer data in file between two devices.
I have seen tutorial regarding Bluetooth chat but can't figure out what stuff needed for file transfer. How can I do this?
Something like this:
You need the MAC address of the device to which you are going to connect, and then just use the InputStream and OutputStream of
bs
.Please set this code in your button and set uri to file path then press button your file will be transferred.
Today i had the same task & after spending couple of hours i'd achieved this. I'm posting the whole code so someone else can easily understand this. This is my Activity:
This is my layout:
Last step is please declare all the permissions in manifest:
That's it.
File transfer is same like you send message. First you convert file to input stream and then transfer this to founded device.