tajchert / BusWear

EventBus for Android Wear devices.
Apache License 2.0
257 stars 23 forks source link

Support for byte [] #7

Open greenspand opened 9 years ago

greenspand commented 9 years ago

Hi, Great Library by the way. Works like a charm. However, I wanted to ask if in future releases you will support byte[]. The simple reason is that I use proto-buffers in all my wear projects. Reason is obvious, it is faster than Serializable or Parcelable and it is cross platform. I do have to send my messages as a byte[]. The only way I can do it with BusWear right now is by using the Object Parcelable approach, but this would defy the purpose of using protobuffers in the first place. I think it would be awesome if there would be byte [] support. One wouldn't need Parcelable anymore, instead protobuffers which are platform agnostic. What do you think?

greenspand commented 9 years ago

BusWear is a wrapper for the Data and Messgae API right?

tajchert commented 9 years ago

It is for Message API only. Do you want to receive byte[] such as onEvent(byte[] array)? Or to receive in onEvent() your unparsed object from byte[](like currently)?

greenspand commented 9 years ago

I would like to be able to receive onEvent(byte[]array) and send EventBus.getDefault.post(byte[]array); I just need the byte[] array data type option. The reason is that I am transforming my protobuffer models into a byte [] and on the other side, the wear app, back to my Objects. I use this library from Suare, for the protobuffer: https://github.com/square/wire It would be great if you could implement this option, think of all the interoperability, speed and ease of use. You wouldn't need Parcelable or Serializable, hence protobuff is a binary format. Based on my queries, protobuffer is faster than Pracelable and Serializable. So you would get the Object advantages at the speed of binary. For The DataApi it works, I tested it on my apps and its super fast. I don't know on the Messages API, is there a payload limit?