Dear @VIKNESSHWAR_A_B,
@Abg has already told you about permissions and could still be the root cause.
Anyway, here below you can find an Arduino code working for me.
Annexed you can find also a revised version of your .aia .
Both are working together: the .aia, compiled to an .apk and downloaded onto my Lenovo Pad (Android 10), while the Arduino is running on a Mega2560 connected to an HC05 (whose baudrate is 115200 bps). If your HC05 works @9600, you have obviously to change the 115200 value to 9600 (please be aware that sometimes some HC05's have a factory set default baudrate @38400).
My HC05 is connected to pins 0, 1 of my Mega. The pin 0 (Mega Rx pin, is connected to the Tx pin of the HC05, while pin 1, the Tx Mega pin, is connected to the Rx pin of the HC05 by means of a resistors partition, as per the design here below:
And now the Arduino code:
#define LED 13
void setup()
{
Serial.begin(115200); // towards HC05 (mine works at that baudrate)
pinMode(LED, OUTPUT); // LED on board
digitalWrite(LED,LOW); // self test of LED
delay(1000);
digitalWrite(LED,HIGH);
delay(1000);
digitalWrite(LED,LOW);
}
void loop()
{
char Char_In;
if (Serial.available() > 0) // something from APP ?
{
while (Serial.available()) // repeat fetch input char until available
{
Char_In = Serial.read(); // get it
if(Char_In == '1') digitalWrite(LED,HIGH); // set LED on if character received = 1
if(Char_In == '0') digitalWrite(LED,LOW); // set LED to OFF if character received = 0
delay(1); // wait a while
}
}
}
BLUETOOTH_LED.aia (71.5 KB)
The app's blocks (contained in the above.aia) are shown here below:
You'll see that the Screen1.initialize has a commented block (the bluetooth ask for permission. The first time that I run the app on my Lenovo pad, the presence of the two blocks "ask for permission" produce an enquiry by Android, that asks the user to enable, in the Android device settings, the BT comm's and the "fine location". Once given this authorization to the app, it isn't necessary any longer to ask for the same permission: to this purpose I've commented out the relevant block.
Best wishes

