Receiving multiple data at arduino from android program

Hello Everyone,

I'm new to Arduino coding. I'm developing an Android app which communicates with arduino board via bluetooth module HC-06. I've a requirement of receiving multiple data simultaneously at arduino board from Android app. I'm sending 3 data from my android app. Those 3 data I need to read in two or three separate "char" or "int" variables. I'm unable to read those data arduino. Kindly provide me the correct code to achieve my requirement.

Thank you in advance.

Start by searching this forum for HC-06 and you will get over 2000 matches, some of which will surely help you do what you want.

I'm sending 3 data from my android app

But I'm not going to tell you how.

Those 3 data I need to read in two or three separate "char" or "int" variables.

When you make up your mind which type, and how many, feel free to share.

I'm unable to read those data arduino.

Or to share your code or explain exactly what does happen.

Kindly provide me the correct code to achieve my requirement.

Kindly provide me the correct amount of money, first.

Kindly provide me the correct code to achieve my requirement.

Develop your arduino code using the serial monitor, then move to having the data sent from the Android. Generally it is best to delimit the data packets for better capture, capture the data packets, then extract the desired info from the packet. The below code is this type of activity.

//zoomkat 3-5-12 simple delimited ',' string  
//from serial port input (via serial monitor)
//and print result out serial port

String readString, data;
int CD, CM, CT, CS, BR; 

void setup() {
  Serial.begin(9600);
  Serial.println("serial delimit test 1.0"); // so I can keep track of what is loaded
}

void loop() {

  //expect a string like CD01,CM01,CT01,CS03,BR255,

  if (Serial.available())  {
    char c = Serial.read();  //gets one byte from serial buffer
    
    if (c == ',') {
      Serial.println(readString); //prints string to serial port out
      
      if(readString.indexOf("CD") >=0) {
        data=readString.substring(2);
        Serial.print("CD is: ");
        Serial.println(data);
        CD = data.toInt();
        Serial.println(CD);
        Serial.println();
      }
      if(readString.indexOf("CM") >=0) {
        readString=readString.substring(2);
        Serial.print("CM is: ");
        Serial.println(readString);
        CM = readString.toInt();
        Serial.println(CM);
        Serial.println();
      }
      if(readString.indexOf("CT") >=0) {
        readString=readString.substring(2);
        Serial.print("CT is: ");
        Serial.println(readString);
        CT = readString.toInt();
        Serial.println(CT);
        Serial.println();
      }
       if(readString.indexOf("CS") >=0) {
        readString=readString.substring(2);
        Serial.print("CS is: ");
        Serial.println(readString);
        CS = readString.toInt();
        Serial.println(CS);
        Serial.println();
      }
       if(readString.indexOf("BR") >=0) {
        readString=readString.substring(2);
        Serial.print("BR is: ");
        Serial.println(readString);
        BR = readString.toInt();
        Serial.println(BR);
        Serial.println();
      }
      
      //do some stuff

      readString=""; //clears variable for new input
      data=""; 

    }  
    else {     
      readString += c; //makes the string readString
    }
  }
}