Not receving the complete data from arduino via bluetooth in android :        #include <SoftwareSerial.h>
                            
                            int bluetoothTx = 11;
                            int bluetoothRx = 12;
                            
                            SoftwareSerial bluetooth(bluetoothTx, bluetoothRx);

      void setup()
    {
      //Setup usb serial connection to computer
                              Serial.begin(9600);
                             
                             bluetooth.begin(9600);
    }
    void loop()
    {
    //Read from bluetooth and write to usb serial
    if(bluetooth.available())
     {
        char tosend = (char)bluetooth.read();
    
    Serial.print(tosend);

      if ( tosend == '1' )
                                {
                                  Serial.println("Hello");
                                 bluetooth.println("Hellllo");
                                }
      }

 
    }


this is my ardiuno code ...


in android side i have use this function

  public void run() {

        byte[] buffer = new byte[1024];  // buffer store for the stream
        int bytes = 0; // bytes returned from read()

        // Keep listening to the InputStream until an exception occurs
        while (true) {
            try {
                // Read from the InputStream
                bytes = mInStream.read(buffer);
                // Send the obtained bytes to the UI activity
                mHandler.obtainMessage(Constants.MESSAGE_READ, bytes, -1, buffer)
                        .sendToTarget();
            } catch (IOException e) {
                Log.i(TAG, e.toString());
                break;
            }
        }
     }

Second thing is that even i have not wirtten delay 
still my output in android side is splited in thread.

So please help


