About using slider bar to control PWM LED luminance

Hello guys
I need some help in my app build.
So, I want to use the Android app to control the LED luminance using an ESP32 module and Bluetooth.

How can create the block in MIT to do this?

Huge thanks for everyone willing to help me.

Here the code in Arduino IDE:

/PWM LED
// the number of the LED pin
const int RledPin = 25; // 16 corresponds to GPIO16

// setting PWM properties
const int LEDfreq = 1000;
const int RledChannel = 0;
const int Rresolution = 8;

void setup() {

//PWM LED
// configure LED PWM functionalitites
ledcSetup(RledChannel, LEDfreq, Rresolution);

// attach the channel to the GPIO to be controlled
ledcAttachPin(RledPin, RledChannel);

}

void loop() {

//PWM LED
// increase the LED brightness
for(int dutyCycle = 0; dutyCycle <= 255; dutyCycle++){
// changing the LED brightness with PWM
ledcWrite(RledChannel, dutyCycle);
delay(15);
}

// decrease the LED brightness
for(int dutyCycle = 255; dutyCycle >= 0; dutyCycle--){
// changing the LED brightness with PWM
ledcWrite(RledChannel, dutyCycle);
delay(15);
}
}PWM_LEDtest.aia (805.8 KB)