1

Anybody got a handle on the new Channel API?  The Android site says it can be used to send music files, for example. However, the docs for the Channel object say that receiveFile and sendFile should only be used once on any channel. The only example using channel I can find is here on StackOverflow to send a single file. How can Channel send many files? Does an app create many channels? Is the developer supposed to combine the files into one?

Any insight would be most welcome. Is there any reason to update code that uses assets to use channels instead?

Beth Mezias
  • 270
  • 3
  • 13

1 Answers1

0

You can have multiple channels so the easiest is to open one channel per file if you need to try multiple transfers.

Ali Naddaf
  • 16,951
  • 2
  • 21
  • 28
  • Yes, the documentation is clear, however, the easiest is actually to continue to use the assets and data layer that worked with previous Wear releases. What is the advantage to using channels over assets? Where is the sample code for channel objects. – Beth Mezias Aug 30 '15 at 01:49
  • The most important difference is that the Assets are replicated across all nodes on a network while ChannelApi can target a subset of nodes so this can be advantageous if you don't want to sync a data file across all devices. You can take a look at Sending And Syncing Data (http://developer.android.com/training/wearables/data-layer/index.html) and scroll down to the Channels to see if the benefits there are important for your case or not. – Ali Naddaf Aug 30 '15 at 01:58
  • This sounds like a difference but when I look at the documentation I find that using the URI format required for the Data API, wear:///, also sets which nodes receive the data. It would help to have some examples. I still do not see the difference. What is the reason to change from the data api to the channel? Where is the advantage? – Beth Mezias Sep 08 '15 at 01:38
  • The is the node that has created the item not of the recipient. – Ali Naddaf Sep 08 '15 at 05:20