 void loop() {
   switch (state) {
     case STATE_INIT:
-      if (Serial.peek() != 0xFF) {
+      //if (Serial.peek() != -1 ) {
+      if (Serial.peek() == 0xFF ) {
         state = STATE_WRITE;
       }
       break;

#define STATE_READ 3

#define STRING_EOS "#_EOS_EOS_EOS_EOS_EOS_"

static int state = STATE_INIT;


      Serial.println("import android,time");
      Serial.println("droid = android.Android()");
      Serial.println("droid.makeToast('Play Movie')");
      Serial.println("droid.webViewShow('http://www.youtube.com/watch?v=pdbSLpBgQ2I', True)");
      //Serial.println("droid.webViewShow('https://docs.google.com/file/d/0B14PZnE7DkYmck9Yc2tlcTZwTnM/edit?usp=sharing', True)");

      state = STATE_WRITE_DONE;
      break;

    case STATE_WRITE_DONE:
//     delay(5000);
     Serial.print(STRING_EOS);

      state = STATE_READ;

