mySerial.available() is returning 0 I am using bluetooth hc-05, arduino uno and ap app created by mit app inventor.The problem is myserial.available is returning 0 and hence its loop is not getting executed. I had connected four pins of the hc-05 module. Rx to pin 10, Tx to pin 11, VCC to 5V, GND to GND. On the app it is showing that the mobile is connected to HC-05 however the condition is not met.

#include &lt;SoftwareSerial.h&gt;
SoftwareSerial mySerial(10, 11); 

String name="";
void setup() {
  // Open serial communications and wait for port to open:
  Serial.begin(9600);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB port only
  }


  Serial.println("Goodnight moon!");

  // set the data rate for the SoftwareSerial port
  mySerial.begin(9600);
  Serial.println("Hello, world?");
}

void loop() { // run over and over
  if (mySerial.available()) {
    Serial.println("Bluetooth is connected");
    name=mySerial.read();
    Serial.println(name);
  }
  else
 {
   Serial.println("Bluetooth is not connected");
  }
}
I found out my solution. Actually I was connecting Rx to Rx and Tx to Tx.