HC-06 Bluethooth module with android.

I bought this item(Bluetooth RF Transceiver Serial Module) :
http://www.ebay.com/itm/291265145410?_trksid=p2060778.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT

Im trying to turn off and on led, but it doesnt work. Conected all pins, and using this code:

int ledPin = 13;
int state = 0;
int flag = 0;

void setup() {
pinMode(ledPin, OUTPUT);
digitalWrite(ledPin, LOW);

Serial.begin(9600); // Default connection rate for my BT module
}

void loop() {

if(Serial.available() > 0){
state = Serial.read();
flag=0;
}

if (state == ‘0’) {
digitalWrite(ledPin, LOW);
if(flag == 0){
Serial.println(“LED: off”);
flag = 1;
}
}

else if (state == ‘1’) {
digitalWrite(ledPin, HIGH);
if(flag == 0){
Serial.println(“LED: on”);
flag = 1;
}
}
}

I'm sure the code is kosher. Does it work OK on the serial monitor if bluetooth is disconnected? Is the HC-05 properly paired? Have you established the connection from Android (LED on bluetooth is steady)

Are you using an Uno? If so use SoftwareSerial to create a serial connection for your Bluetooth module on a couple of other pins (not 0 and 1) and use the USB connection to your PC so you can show on the Serial Monitor what is being received from the Bluetooth module.

I think that is the same as the Module I have, but mine is not mounted on a PCB with pins. Mine is strictly a 3.3v device and I can't figure from your link if yours is adapted to work with 5v - but I don't think it is (have you any definitive documentation on the matter?) If it is a 3.3v device you are likely to damage it by connecting it to the Arduino's 5v output pins.

...R