Problem with using quotes in EditText (Android development )


(Mohemedbilel15) #1

I started develpping an android application so i’m asking to get some help.
i have problem with using quotes in EditText
2018-07-23_19-45-46
that’s what i started with
but when i puted all of my text in EditText, ther is a problem of double quotes i think.
here the code :

          <EditText
            android:id="@+id/editText"
            android:layout_below="@+id/ArduinoText"
            android:layout_width="match_parent"
            android:layout_height="495dp"
            android:layout_marginBottom="16dp"
            android:layout_marginRight="8dp"
            android:layout_marginLeft="8dp"
            android:layout_marginTop="16dp"
            android:background="@android:color/white"
            android:ems="10"
            android:gravity="top"
            android:inputType="textMultiLine"
            android:padding="10dp"
            android:singleLine="true"
            android:text="char command;
    String string;
    boolean ledI = false;
    boolean ledII = false;
    #define led1 1
    #define led2 2
    #define led3 11
    #define led4 22
      void setup()
      {
        Serial.begin(9600);
        pinMode(led1, OUTPUT);// led of BT
        pinMode(led2, OUTPUT);// led of BT
        pinMode(led3, OUTPUT);// led of BT
        pinMode(led4, OUTPUT);
      }

      void loop()
      {
        if (Serial.available() > 0)
        {string = "";}

        while(Serial.available() > 0)
        {
        command = ((byte)Serial.read());

        if(command == ':')
        {
        break;
        }

        else
        {
        string += command;
        }

        delay(1);
        }

        if(string == "O")
        {
        ledO();
        ledI = true;
        }
        if(string == "OO")
        {
        ledOO();
        ledII = true;
        }

        // ---------
        if(string =="X")
        {
        ledX();
        ledI = false;
        Serial.println(string);
        }
        if(string =="XX")
        {
        ledXX();
        ledII = false;
        Serial.println(string);
        }

        }
        void ledO(){

        digitalWrite(led1, HIGH);
        digitalWrite(led2, HIGH);
        delay(100);
        }
        void ledOO(){

        digitalWrite(led2, HIGH);
        digitalWrite(led4, HIGH);
        delay(100);
        }

        void ledX(){

        digitalWrite(led1, LOW);
        delay(10);
        digitalWrite(led2, LOW);
        delay(10);
        }

        void ledXX(){

        digitalWrite(led3, LOW);
        delay(10);
        digitalWrite(led4, LOW);
        delay(10);
        }"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent"

            />

one more thing, how i can scroll it up and down .
Thanks.