how to receive status of push button arduino via mti app inventor2

i want receive status of push button and show if high or low on the smartphone. i have issue in mti app blocks

SoftwareSerial mySerial(2, 3); // Sets Arduino (RX, TX) pins
int testLED = 13; //Test LED
const int buttonPin = 8;


byte currentRead; //whats the current number we've got
byte buttonStatus = 0;
int buttonState = 0; //variable for readin the push button status

void setup() {

  pinMode(testLED, OUTPUT);
  pinMode(buttonPin, INPUT);  // Button pin
  mySerial.begin(9600);
}

void loop() {
  while (mySerial.available() > 0) {
    currentRead = mySerial.read();
        mySerial.write(buttonStatus);
      }

  buttonState = digitalRead(buttonPin);
  if (buttonState == HIGH) {
    buttonStatus = 20;
    digitalWrite(testLED, HIGH);
  }
    else{
    buttonStatus = 10;
    digitalWrite(testLED, LOW);
  } 
  }

Moderator edit:
</mark> <mark>[code]</mark> <mark>

</mark> <mark>[/code]</mark> <mark>
tags added.

@Radwanka, do not cross-post. Do not hijack. Other post removed.

:o
sorry what you mean?

Do not post your question in multiple places. Pick the one you believe is the best choice then post your question in that one place.

Do not post your question to an existing thread.

  while (mySerial.available() > 0) {
    currentRead = mySerial.read();
        mySerial.write(buttonStatus);
      }

If there is incoming serial data to read, read it AND send the value in buttonStatus, even though you haven't read the status of a button (or switch, either).

Why?

Why are you sending data before you have assigned a meaningful value to buttonStatus?

Why does sending that data depend on having received data? Why is the app sending data that you don't use?

i want use this on my car to get status of doors and lights whatever. so if one of pins are activated that send data over Bluetooth and show up on my app phone>

i want use this on my car to get status of doors and lights whatever. so if one of pins are activated that send data over Bluetooth and show up on my app phone>

So, why are you sending data first, and then seeing if there is anything you should send?

Why are you only sending data if you have gotten data from the phone?