keep sending data from arduino to java via bluetooth HC-05

i've a project of smart bin , I'am trying to keep sending data via bluetooth but i i don't know how can i keep conection between bluetooth and java , iam using now library of bluecove but it just can send 1 time the data , and when i want to put a loop it didin't work
so :

code :

package com.jacobtrashcompany.Repository;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.Socket;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.bluetooth.DeviceClass;
import javax.bluetooth.DiscoveryAgent;
import javax.bluetooth.DiscoveryListener;
import javax.bluetooth.LocalDevice;
import javax.bluetooth.RemoteDevice;
import javax.bluetooth.ServiceRecord;
import javax.bluetooth.UUID;
import javax.microedition.io.Connector;
import javax.microedition.io.StreamConnection;

public class HC06 {
    boolean scanFinished = false;
    int x = 1 ;
    String hc06Url =
    "btspp://FCA87A00B212:1;authenticate=false;encrypt=false;master=false";
    
     //Replace this with your bluetooth URL
  
    public String go() throws Exception {

    StreamConnection streamConnection = (StreamConnection)
    Connector.open(hc06Url);
    //OutputStream os = streamConnection.openOutputStream();
    InputStream is = streamConnection.openInputStream();
    //os.write("1".getBytes()); //'1' means ON and '0' means OFF
    //os.close();
    
    byte[] b = new byte[1000];
   // Thread.sleep(300);
    is.read(b);
    is.close();
     //streamConnection.close();
    String A = new String(b);
 
    return new String(b) ;
}
public static void main(String[] args) throws Exception {
    HC06 hc = new HC06();
    try {
        String a = hc.go();
        System.out.println(a);
    }catch(Exception e){}

}

}

arduino code :

#include <Servo.h> 
#include <dht.h>
#define dht_apin A0 // Analog Pin sensor is connected to


dht DHT;


Servo myservo1;  // create servo object to control a servo
Servo myservo2;  // create servo object to control a servo

int pos = 0;  // variable to store the servo position
int receivedData;
int flag =0;
int analog_IN = A0;  // This is our input pin humidity


const unsigned int TRIG_PIN=13;
const unsigned int ECHO_PIN=12;


const unsigned int TRIG_PIN1=9;
const unsigned int ECHO_PIN1=8;


const unsigned int BAUD_RATE=9600;

void setup() {
  pinMode(TRIG_PIN, OUTPUT);
  pinMode(ECHO_PIN, INPUT);

   pinMode(TRIG_PIN1, OUTPUT);
  pinMode(ECHO_PIN1, INPUT);
  Serial.begin(BAUD_RATE);

   myservo1.attach(9);   
  myservo2.attach(10); 

  // humidity
 Serial.begin(9600); 
}

void loop() {
  if(Serial.available()>0){
  receivedData = Serial.read();
  flag = 1;
}




  
  digitalWrite(TRIG_PIN, LOW);
  delayMicroseconds(2);
  digitalWrite(TRIG_PIN, HIGH);
  delayMicroseconds(10);
  digitalWrite(TRIG_PIN, LOW);

  

 const unsigned long duration= pulseIn(ECHO_PIN, HIGH);
 int distance= duration/29/2;

 const unsigned long duration1= pulseIn(ECHO_PIN1, HIGH);
 int distance1= duration1/29/2;




 if (distance < 30 ){

    // sweeps from 0 degrees to 180 degrees
  
  for(pos = 0; pos<=180; pos+=6)
  {
    myservo1.write(180);
    myservo2.write(180);
    delay(200);
  }

 }
  else {
  
  for(pos = 180; pos >= 0; pos -= 3) 
  {
    myservo1.write(0);
    myservo2.write(0);
    delay(15);
  
  }

    
  }

  myservo1.detach();
   myservo2.detach();
   myservo1.attach(9);
   myservo2.attach(10);
    
    
    // humidity
   DHT.read11(dht_apin);
     int Temp = DHT.temperature ;
     int Humidity = DHT.humidity ;
     Serial.begin(9600);
delay (200) ;
      Serial.print(Temp);
      Serial.print("-");
      Serial.print(Humidity);
      Serial.print("-");
      Serial.println(distance1);

  Serial.flush();

 
  }

You appear to be using one serial twice - not necessarily for two serial devices. Otherwise, this would not appear to be an Arduino problem - unless Bluetooth is wired the wrong way round. You can verify your code by engaging the serial monitor. Serial.flush would appear to be redundant. The same can be said for all that white space in the code. Indeed, it is most discourteous.