Public Wi-Fi hotspots with captive portals — those websites where you have to accept terms and conditions or log in before you can access the internet — are the bane of existence for people who frequent cafés. Sometimes Android's captive portal check fails, and you have to figure out which website to visit to accept the terms. Other times, you'll notice it's hard to revisit the captive portal when you want to check how much data allowance you have left. Google is trying to make that whole process a lot smoother with Android 11, but it has to rely on public Wi-Fi providers' help for that.

Android 11 Beta 2 was the first to ship with a new captive portal API that gives access points a reliable way to identify themselves as captive portals. The interface is based on the Internet Engineering Task Force's specifications that describe how these networks should be set up to be recognized properly and that propose how such an API should look like. This hopefully means that the API will be adopted on other systems like Windows, macOS, iOS, and Linux, as well, and everyone will soon have it easier when they need to go online while in public.

Android has supported captive portal detection since Android 5.0 (API level 21), but the current method relies on sending cleartext HTTP probes to known destinations (e.g., connectivitycheck.google.com). When this query is redirected, the system will assume that a captive portal is in place. However, since there is no standardized address to probe, this method is unreliable and prone to errors. Some probes could accidentally be blocked or allowed instead of being redirected, making it seem like there is no captive portal. Since most (if not all) public Wi-Fi networks don't support the newly announced API yet, Android 11 will continue falling back on this method when needed.

Android 11 also supports venue-published information. That means that venue owners can link to a website of their choosing once you've logged in or agreed to the terms. A café could show its menu, and a museum could offer information on its exhibitions. These websites will be available through the network details in Settings and via the notification you receive when your internet connection is successfully established — see above.

Google also plans on updating the API via Play Services in the future. It wants to add remaining time and remaining data stats to inform people how much longer they'll be able to use the network.

Android 11 has some more Wi-Fi tricks up its sleeve, like an option to prevent auto-connecting to known networks and wireless debugging.

Source: Google