Bluetooth communication Problem

I’m trying to control a servo motor by sending the angle(int) using the serial monitor to the Arduino Uno board via bluetooth (BlueSmirf Gold). The problem is that the motor responds to the first value sent only although the code is in a loop and when applying the same code but communicating via usb the servo motor responds to every angle sent.
Here is my code:

#include <Servo.h>
int angle;
Servo myservo;
void setup() {
Serial.begin(9600);
myservo.attach(9);

}

void loop() {
while (!Serial.available()); // stay here as long as COM port is empty
angle = Serial.parseInt(); // read next available int
myservo.write(angle);

}

The problem is that the

bluetooth device is using the hardware serial port, making debugging the program impossible.

Get the bluetooth device off the hardware serial pins.

what do you mean exactly? Do you mean to disconnect it from pins 0 & 1? Because I have done that. And still having the same problem.

Do you mean to disconnect it from pins 0 & 1? Because I have done that. And still having the same problem.

So, you disconnected the bluetooth device, and it still doesn't work. Well, color me surprised.

You might try connecting it to two different pins, and using SoftwareSerial to read from/write to the bluetooth device.

Isramali: The problem is that the motor responds to the first value sent only

Are you quite sure that is really happening? I can't see how you can get one response only.

Isramali: when applying the same code but communicating via usb the servo motor responds to every angle sent.

This implies there is nothing wrong with the code. It also implies that you already know how to debug it in the proper manner, and the problem would normally be more likely incorrect connections (Rx>Tx/Tx>Rx).

It is possible that you are not sending the code you think you are sending - Android problem.