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

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

      state = STATE_WRITE_DONE;
      break;

    case STATE_WRITE_DONE:
      Serial.print(STRING_EOS);

      state = STATE_READ;


#define STATE_READ 3

#define STRING_EOS "#_EOS_EOS_EOS_EOS_EOS_"
#define COMMAND_START_TO_LOAD 0xFF

static int state = STATE_INIT;

