title: Android Wear Message API Encoding and Decoding Byte[]
body: <p>I've written a simple app the uses the Android Wear Messaging API. I followed a number of guides that all use a similar style of code for sending the message with some data which should be in byte[] form. </p>
  
  <p>The code sending the message is </p>
  
  <pre><code>Wearable.MessageApi.sendMessage(client, nodeId, message, "test".getBytes());
  </code></pre>
  
  <p>and the receiving code is </p>
  
  <pre><code>final String messageData = new String(messageEvent.getData());
  </code></pre>
  
  <p>This seems to fit with a number of different guides and some of the official documentation - however the variable <code>messageData</code> ends up containing <code>[B@4b0ad22</code> rather than <code>test</code> which is the data that was sent. </p>
  
  <p>I've also tried explicit encoding/decoding with </p>
  
  <pre><code>String messageData = new String(messageEvent.getData(), "UTF-8");
  </code></pre>
  
  <p>but that throws a <code>java.io.UnsupportedEncodingException</code></p>
  
  <p>What's going wrong with the encoding or decoding?</p>