java – I am trying to receive Arduino Bluetooth data in android app but the value I received in android app is constantly repeating

Here is my Arduino code:

#include <Wire.h> 
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 2);
#include<SoftwareSerial.h>
SoftwareSerial bt(2,3);
float bat=A3;
int input=A0;
float bat1;
int input1;
int relay=8;
int a;
char s;
/////////////////////////////////////////

void setup(){
lcd.init();


 bt.begin(9600);


 Serial.begin(9600);
 pinMode(bat,INPUT);
  ////////////////////////////////////////////


 pinMode(relay,OUTPUT);
   digitalWrite(relay,HIGH);
   delay(1000);
   
    lcd.backlight();
    lcd.print("Battery Charging");
  delay(2000);
  lcd.clear();
}

void loop()
{
  voltage();
  delay(400);

//////////////////////////////////////////////////////
  //////////////////////////////////////////////////////////////////////////
  if(bat1>=880)
  {
    bat1=880;
  }
  a=(bat1/880)*100;
  Serial.println(a);
  bt.print(a);
  //////////////////////////////////
  //////////////////////////////
  ///////////////////
  ////////////////////
  /////////
  if(a>=100)
  {
    a=100;
  }
  if(a<0)
  {
    a=0;
  }
  lcd.setCursor(0,1);
  lcd.print("Charge=");
  lcd.print(a);
  lcd.print("%");
  if(bt.available()>0)
  {
   s=  bt.read();
  }
  Serial.print(s);
  if(s=='1')
  {
    
    lcd.setCursor(0,0);
    lcd.print("Charging start");
    Serial.println("receive 1");
    digitalWrite(relay,LOW);
  }
  if(s=='0')
  {
    
  
    lcd.setCursor(0,0);
    lcd.print("No Charging ");
    Serial.println("receive 0");
    digitalWrite(relay,HIGH);
  }
  delay(2000);
  lcd.clear();
}
void voltage()
{
  bat1=analogRead(bat);
  Serial.println(bat1);
}

Here is my Android code

  import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;

import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothSocket;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.IntentFilter;
import android.icu.text.DateFormat;
import android.icu.text.TimeZoneFormat;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;

import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseUser;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.database.core.Tag;
import com.google.firebase.firestore.DocumentReference;
import com.google.firebase.firestore.DocumentSnapshot;
import com.google.firebase.firestore.EventListener;
import com.google.firebase.firestore.FirebaseFirestore;
import com.google.firebase.firestore.FirebaseFirestoreException;
import com.google.type.DateTime;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.time.format.DateTimeFormatter;
import java.util.Calendar;
import java.util.Set;
import java.util.UUID;
import java.util.regex.Pattern;

public class ChargeStatus extends AppCompatActivity {
    private static final String TAG = "ChargeStatus";
     BluetoothSocket socket;
     BluetoothDevice device;
    private OutputStream outputStream;
    private InputStream inputStream;
    String address = "00:19:10:08:29:F1";
    static final UUID myUUID = UUID.fromString("00001101-0000-1000-8000-00805F9B34FB");
    EditText chargestatus;
    BluetoothAdapter bluetoothAdapter;
    Button logout, start, stop;
    boolean deviceConnected=false;
    Thread thread;
    byte buffer();
    int bufferPosition;
    boolean stopThread;




    @RequiresApi(api = Build.VERSION_CODES.N)
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_charge_status);
        logout = findViewById(R.id.button2);
        start = findViewById(R.id.button);
        stop = findViewById(R.id.button3);
        chargestatus = findViewById(R.id.textView8);
       

        bluetoothAdapter = BluetoothAdapter.getDefaultAdapter();


       

       

        logout.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                fAuth.getInstance().signOut();
                startActivity(new Intent(ChargeStatus.this, Login.class));
                finish();

            }
        });

        start.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if(BTinit())
                {
                    if(BTconnect())
                    {

                        deviceConnected=true;
                        beginListenForData();

                        Toast.makeText(getApplicationContext(),"Connection Open",Toast.LENGTH_SHORT).show();

;
                    }

                }
                
                if (socket!=null)
                {
                    try {
                        outputStream.write("1".toString().getBytes());
                    } catch (IOException e) {
                        e.printStackTrace();
                    }
                }

               


            }
        });
        stop.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                  if (socket!=null)
                {
                    try {
                        outputStream.write("0".toString().getBytes());
                    } catch (IOException e) {
                        e.printStackTrace();
                    }
                }
                if (socket!=null) //If the btSocket is busy
                {
                    try
                    {
                        socket.close(); //close connection
                    }
                    catch (IOException e)
                    { Toast.makeText(getApplicationContext(),"Error",Toast.LENGTH_SHORT).show();
                    }
                }
                stopThread = true;

              
              
            
            }

        });


    }

    private void beginListenForData() {
        final Handler handler = new Handler();
        stopThread = false;
        buffer = new byte(1024);
        Thread thread  = new Thread(new Runnable()
        {
            public void run()
            {
                while(!Thread.currentThread().isInterrupted() && !stopThread)
                {
                    try
                    {
                        int byteCount = inputStream.available();
                        if(byteCount > 0)
                        {
                            byte() rawBytes = new byte(byteCount);
                            inputStream.read(rawBytes);
                            final String string=new String(rawBytes,"UTF-8");
                            handler.post(new Runnable() {

                                public void run()
                                {

                                    chargestatus.append(string);
                                }
                            });

                        }
                    }
                    catch (IOException ex)
                    {
                        stopThread = true;
                    }
                }
            }
        });

        thread.start();
    }

    private boolean BTinit() {
        boolean found=false;
        BluetoothAdapter bluetoothAdapter=BluetoothAdapter.getDefaultAdapter();
        if (bluetoothAdapter == null) {
            Toast.makeText(getApplicationContext(),"Device doesnt Support Bluetooth",Toast.LENGTH_SHORT).show();
        }
        if(!bluetoothAdapter.isEnabled())
        {
            Intent enableAdapter = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
            startActivityForResult(enableAdapter, 0);
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
      
        Set<BluetoothDevice> bondedDevices = bluetoothAdapter.getBondedDevices();
        if(bondedDevices.isEmpty())
        {
            Toast.makeText(getApplicationContext(),"Please Pair the Device first",Toast.LENGTH_SHORT).show();
        }
        else
        {
            for (BluetoothDevice iterator : bondedDevices)
            {
                if(iterator.getAddress().equals(address))
                {
                    device=iterator;
                    found=true;
                    break;
                }
            }
        }

        return found;

    }

  public boolean BTconnect()
  {
      boolean connected=true;
      try {
          socket = device.createRfcommSocketToServiceRecord(myUUID);
          socket.connect();
      } catch (IOException e) {
          Toast.makeText(this, ""+e.getMessage(), Toast.LENGTH_SHORT).show();
          e.printStackTrace();
          connected=false;
      }
      if(connected)
      {
          try {
              outputStream=socket.getOutputStream();
          } catch (IOException e) {
              e.printStackTrace();
          }
          try {
              inputStream=socket.getInputStream();
          } catch (IOException e) {
              e.printStackTrace();
          }

      }
      return connected;

  }

the value I received from Arduino Bluetooth to android app is constantly repeating

the value I received from Arduino Bluetooth to android app is constantly repeating.
the value I received from Arduino Bluetooth to android app is constantly repeating.
the value I received from Arduino Bluetooth to android app is constantly repeating.
the value I received from Arduino Bluetooth to android app is constantly repeating.
the value I received from Arduino Bluetooth to android app is constantly repeating.
the value I received from Arduino Bluetooth to android app is constantly repeating.
the value I received from Arduino Bluetooth to android app is constantly repeating.
the value I received from Arduino Bluetooth to android app is constantly repeating.