title: Pebble communication methods
body: <p>I've been experimenting with pebble for a day or two now and I've reached a bit of a standstill. That is, I can't seem to figure out how certain things are related. What I'm trying to do is get data from an app on Android to be sent to pebble, and for pebble to then do something productive with that data.</p>
  
  <p>I've realized that you use the PebbleKit API within an android application in order to communicate with the pebble, using things such as <code>sendDataToPebble()</code>. After that, though, I'm not quite sure what to do.</p>
  
  <p>Using cloudpebble.net, I've created an application in C using the pebble SDK to acknowledge the data (using the handlers as suggested on their website). However, I've recently discovered that there can also be javascript in this entire mix, and I just don't know how to interface with the js. </p>
  
  <p>Is it possible to have all ack/nack of data, and subsequent processing/displaying of data done entirely through javascript, avoiding the C entirely, or do i need to receive the data in c, and then send it to javascript some how for it to use (which I don't currently know how to do). </p>
  
  <p>I <em>believe</em> there is some sort of event that is triggered (<code>appmessage</code>, I think), when data is received by the JS app, however, I think that is only from the C app?</p>
  
  <p>Thus, mostly, my confusion lies in how JS falls into the entire mix. If someone could clear that up for me I would sincerely appreciate it.</p>
  
  <p>EDIT: I should add that I'm trying to create an app using pebble.js in cloudpebble.net.</p>
  
  <p>Thanks!</p>