user65753: I need to know the IP address of ESP32 on the local network(without printing ip on serial monitor ). The idea is to do mDNS or UDP broadcast to send the IP to the android application. The app will then use that IP to do the communication. Is there someone who has already done it?

user4143: You don't. You configure mDNS (as you already suggested in your question...!) and the client device then queries mDNS to find the device by the name you allocated it.
Look at the ESPmDNS library examples for how to use mDNS.
Edit: if you really want the IP, you can do WiFi.localIP() (station mode) or WiFi.softAPIP() (access point mode). 

65753: <p>I need to know the IP address of ESP32 on the local network(without printing ip on serial monitor ). The idea is to do mDNS or UDP broadcast to send the IP to the android application. The app will then use that IP to do the communication. Is there someone who has already done it?</p>
 4143: <p>You don't. You configure mDNS (as you already suggested in your question...!) and the client device then queries mDNS to find the device by the name you allocated it.</p>

<p>Look at the ESPmDNS library examples for how to use mDNS.</p>

<p>Edit: if you really want the IP, you can do <code>WiFi.localIP()</code> (station mode) or <code>WiFi.softAPIP()</code> (access point mode). </p>
