how does a bluetooth on android works and what are the best alternative in saving data receive from bluetooth? Can anyone confirm this for me although I have tested it myself but when I send a string of data from my android app and send it to arduino say for example data = bluetoothPort.read(); inside an if statement then when I try to use the data in another if statement for example Serial.print(data); inside another if statement it will only show a blank line which let me believe that none of the data are saved. also when a receiving a string of data for example a string of abcde and send it to arduino for example data = bluetoothport.read() and then Serial.print(data) the serial monitor shows abcde as expected but what really happens is data has the value of a then prints then replace by b then print then replace by c then print then replace by d then print then replace by e. Am I wrong or somehow right? are there any work around or parts I need that will make me store data as a whole so that I can use it for other thread or a better code to store string of data?

#include &lt;IRremote.h&gt;
#include &lt;SoftwareSerial.h&gt;



SoftwareSerial bluetoothPort(4,5);
const int RECV_PIN = 12;
const int SEND_PIN = 13;

IRsend irsend;
IRrecv irrecv(RECV_PIN);

decode_results results;
char data;


void setup() 
{
   bluetoothPort.begin(9600);
   Serial.begin(9600);
   irrecv.enableIRIn();
}

void loop() 
{
   if (bluetoothPort.available() &gt; 0)
   {
       data = bluetoothPort.read(); //received bluetooth data from android
   }

   if(irrecv.decode(&amp;results))
   {
       irreceived(); //received IR code from a remote then sends it to my android
       irsend.sendNEC(data, 32)
   }
 }



 void irreceived()
 {
     Serial.println(results.value, HEX);   //receive value of 489010   
     bluetoothPort.println(results.value, HEX); //send value to android
     irrecv.resume();
 }


so the above is a simple sketch that receive data from a remote controller then send it to my android app then when I resend it back to my arduino I would like the data to be able to receive all the data instead of saving it per letter/number and also be able to store it for other statement to use.
Serial communications only consist of one character. That is what serial is - the sending of one character at a time.

How you then deal with those characters, combining them into strings, interpreting them as numbers, whatever, is completely up to you to program.

There is no such thing as a string in serial communications. There is only the character. 

The Arduino API has a few (badly implemented IMHO) helper functions that can get a whole string (kinda), but it is much better (both from a learning perspective and an implementation perspective) to do it yourself.

I have a little tutorial here that may help you get to grips with it.