Need Help for sending data from arduino with module HC-05

Hey Guys, i need help for sending data from arduino to android with HC 05. I can send data to android but it countinous and its make my app in android error , what i need just send once data to android . can anyone help me ?

#define Lamp1 2
#define Lamp2 3
#define Lamp3 4
#define Lamp4 5

#define Motor 13


char val;
const int LDR0 = A0;
const int LDR1 = A1;
const int LDR2 = A2;
const int LDR3 = A3;


int LDRVALUE0 = 0;
int outputValue0 = 0;
int LDRVALUE1 = 0;
int outputValue1 = 0;
int LDRVALUE2 = 0;
int outputValue2 = 0;
int LDRVALUE3 = 0;
int outputValue3 = 0;


void setup() {
pinMode(Lamp1,OUTPUT);
pinMode(Lamp2,OUTPUT);
pinMode(Lamp3,OUTPUT);
pinMode(Lamp4,OUTPUT);
pinMode(Motor,OUTPUT);

Serial.begin(9600);
}

void loop() {


LDRVALUE0 = analogRead(LDR0);
outputValue0 = map(LDRVALUE0, 0, 1023, 0, 255);
LDRVALUE1 = analogRead(LDR1);
outputValue1 = map(LDRVALUE1, 0, 1023, 0, 255);
LDRVALUE2 = analogRead(LDR2);
outputValue2 = map(LDRVALUE2, 0, 1023, 0, 255);
LDRVALUE3 = analogRead(LDR3);
outputValue3 = map(LDRVALUE3, 0, 1023, 0, 255);


if( Serial.available() >0 ) {
val = Serial.read();
Serial.flush();
}

switch(val){
  case '1':
  digitalWrite(Lamp1,HIGH);
  delay(50);
  Serial.println('1');
  delay(50);
  Serial.flush();
  break;
  
  case '2':
  digitalWrite(Lamp2,HIGH); 
  delay(50);
  Serial.println('2');
  delay(50);
  Serial.flush();
  break;
  
  case '3':
  digitalWrite(Lamp3,HIGH); 
  delay(50);
  Serial.println('3');
  delay(50);
  Serial.flush();
  break;
  
  case '4':
  digitalWrite(Lamp4,HIGH); 
  delay(50); 
  Serial.println('4');
  delay(50);
  Serial.flush();
  break;
  
  case 'A':
  digitalWrite(Lamp1,LOW);
  delay(50);
  Serial.println('6');
  delay(50);
  Serial.flush();
  break;
  
  case 'B':
  digitalWrite(Lamp2,LOW);
  delay(50);
  Serial.println('7');
  delay(50);
  Serial.flush();;
  break;
  
  case 'C':
  digitalWrite(Lamp3,LOW); 
  delay(50);
  Serial.println('8');
  delay(50);
  Serial.flush();
  break;
  
  case 'D':
  digitalWrite(Lamp4,LOW);
  delay(50);
  Serial.println('9');
  delay(50);
  Serial.flush();
  break;
  }
}
if( Serial.available() >0 ) {
val = Serial.read();
Serial.flush();
}

If there is data to read, read one byte, then block until all outgoing serial data has been sent. How does THAT make sense?

  Serial.println('1');
  delay(50);
  Serial.flush();

After stuffing your head in the sand for 50 milliseconds, that single character is going to have been sent. There is no reason to block until all outgoing serial data has been sent.

what i need just send once data to android

Once under what circumstances?

The Android KNOWS what it sent. It seems pointless to send the same data back to it, adding only a carriage return and line feed.

If you only want to do THAT once, do it right after you read the value, not every time you execute the switch statement in loop().