see details in this file https://github.com/dnguyen76/ESP32-CW/blob/master/README.md

Most of information to implement this project have been provided by this very knowledgeable arduinofanboy tutorial   see: https://www.instructables.com/id/ESP32-BLE-Android-App-Arduino-IDE-AWESOME/

You will get in this tutorial detailed information for Bluetooth LE (Low Energy) protocol and Bluetooth LE code explanation for ESP32