Android Question How to know when shared file has been sent ?

JTmartins

Active Member
Licensed User
Longtime User
I'm sending a file over to another device via BT. No problem with that.

However to be able to continue properly in my app I would need to know when the transfer of the file has finished.

I've played with the intent "android.btopp.intent.extra.BT_OPP_TRANSFER_STATUS" registered in the manifest editor, but it does not apear to work (Android 6) as the service does not fire up.

B4X:
AddReceiverText(btsent,
<intent-filter>
    <action android:name= "android.btopp.intent.action.BT_OPP_TRANSFER_DONE" />
</intent-filter>)

I've searched the forum and didn't find any information regarding this situation.

Help, would be welcome.
 
Last edited:

JTmartins

Active Member
Licensed User
Longtime User
Hi Mark, Many thanks

Yes, I did. But using streams I only managed to transfer files when both devices are paired, wich is not possible in my stituation as the app runs in a device with a closed Android OS (user has no way to access any of the configuration options or settings). If there is a way, using Async to send the file without the devices being previously paired, I couldn't find it and that was the reason I've used the file share over Bluetooth method.
 
Upvote 0

JTmartins

Active Member
Licensed User
Longtime User
I know Don, but I don't mind. Is a device wich is controlling a machine. The file is only a txt log of operations. So the operators can go to the device and request the file. But due to the way the OS has been "locked" there is no way for the device to show system dialogs (as inserting pairing pins, etc).

I was looking into this post.

But I don't think this is available in Android 6. But when a file is shared there is a toast message saying "file xxxxx has been sent" so there must be some message traveling around informing the OS that the file has been transfered.
 
Upvote 0

JTmartins

Active Member
Licensed User
Longtime User
***UPDATE ****

I managed to catch the message using Notification Listener...So I think I will be able to generate the callback I need with that.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…