I asked ChatGPT for you. Below is the answer
Taifun
The Core Problem
Android cannot resolve .local mDNS hostnames (like http://esp8266.local) natively.
That means in App Inventor:
Web1.Url = "http://esp8266.local"
Web1.Get
This will fail with “Host not found.”
Android simply ignores .local unless an mDNS resolver is built into your app.
Your Options in App Inventor
Option 1: Use a fixed local IP (simplest)
If your ESP8266 usually gets the same IP from the router, you can:
Check its IP once from the serial monitor (WiFi.localIP()).
Then use that IP in your app:
http://192.168.1.123/
Works everywhere
Breaks if the IP changes (DHCP reset, router reboot, etc.)
Option 2: Use a Dynamic mDNS Resolver (with an extension)
App Inventor itself does not support mDNS, but you can add this using an extension (a .aix file).
There are two paths:
Option 2A: Use an existing mDNS extension
As of 2025, there are community-built extensions that wrap Android’s JmDNS library.
Search for:
JmDNS Extension for App Inventor or
mDNS Discovery AIX
For example, an extension like this (if you find one):
JmDNS.aix
It typically adds blocks like:
StartDiscovery("_http._tcp.local.")
WhenServiceFound(name, ip, port)
StopDiscovery
You’d then:
-
Discover the ESP8266 service dynamically.
-
Get its IP.
-
Build the URL dynamically and send it to the Web component.
Example (pseudo blocks):
when Button1.Click
call mDNS.StartDiscovery("_http._tcp.local.")
when mDNS.ServiceFound name ip port
set Web1.Url to "http://" + ip + "/"
call Web1.Get
Works on Android
No manual IP entry
Requires a working .aix extension — there’s no official one from MIT.
If you want, I can show you how to wrap JmDNS into a custom .aix extension yourself (works even without root or special permissions).
Option 3: ESP8266 announces its IP via HTTP or MQTT
Instead of resolving .local, you can make the ESP report its IP:
Variant A: ESP8266 posts its IP to a known server
When booting:
WiFi.localIP().toString();
HTTPClient http;
http.begin("http://your-server.com/report?ip=" + WiFi.localIP().toString());
http.GET();
Your app fetches that IP from the server.
Works with basic App Inventor blocks
Needs Internet / small backend
Variant B: Local UDP broadcast
ESP broadcasts its IP periodically to port (e.g., 4210)
App Inventor app listens via UDP extension (like UDP.aix)
When IP received → Web1.Url = "http:///"
Fully local, no DNS
Requires UDP listener extension
Recommended Practical Setup (2025)
Goal Method Tools Needed
Just want it to work Use static IP on ESP8266 none
Want automatic discovery Use mDNS/JmDNS extension custom .aix
Want local but robust Use UDP broadcast for IP discovery UDP extension
If You Want mDNS via Custom Extension
Yes — you need an extension.
MIT App Inventor doesn’t include the mDNS Java API (JmDNS).
It’s not possible with default blocks only.
You can either:
Find an existing .aix (I can help you locate one or show how to make it),
Or build one using the App Inventor Extension Template and include this library:
implementation 'org.jmdns:jmdns:3.5.5'
Inside, you’d expose a method to start discovery and a callback event when a device is found.
Summary
Approach Works in App Inventor? Needs Extension? Internet? Notes
esp8266.local
No — No Android can’t resolve it
Static IP
Yes No No Simplest workaround
mDNS (JmDNS)
Yes
Yes No Best local discovery method
UDP Broadcast
Yes
Yes No Lightweight alternative
Cloud IP Sync
Yes No
Yes Works even across networks