Search code examples
wear-osandroid-wear-data-api

How should I transfer a large 30MB from wear to mobile?


I am currently using the DataApi and Asset class to transfer a 30MB file from mobile to wear. I am using an IntentService but the file never gets to the mobile. The wear freezes and says "Application is not responding, do you want to wait?"

Should I use a SyncAdapter to send this over? I'm not sure on the best way to do this?


Solution

  • It is better to use ChannelApi methods; first obtain a channel and then use Channel#sendFile() to send the file across. ChannelApi is built for transferring large files and doesn't do a sync across all the devices but rather for the target that you have used to open the channel to. It also saves space on the sender side. If you don't need syncing across multiple connected devices, this is the api to use.