It's not easy living without WiFi, especially when you're travelling, so when your phone is in range of a steady wireless connection, you probably want to stick with it. Unfortunately, our phones aren't always the best at identifying the strongest WiFi signal, but there are ways to fix this.
On Android, you'll stay on your current network until the signal dies completely, and even after your signal dies, you won't necessarily get switched to the next best WiFi broadcast. If you want to take more control over which networks are connected to when, install Wifi Switcher.
The app lets you set up "preferred" routers that take priority at all times as well as configure a custom distance threshold that needs to be reached before your device swaps to a new network (handy if you're in a house or office with lots of access points). You can also turn off mobile data when switching and jump from 5GHz and 2.4GHz bands on the same router.
The app is simple enough to use and find your way around in (even if you're not a wireless networking engineer). Tick the Preferred box next to any WiFi network you want your device to stick with or find first and open up the settings panel via the menu button in the corner to set more options for the app.
There are plenty of alternatives around on Android if you're prepared to do some experimenting. The best one for you might depend on the setup at your home, office, or coffee shop, and the exact features you need. If Wifi Switcher doesn't do it for you, try Swifi Auto Switch or Best Wifi.
Over in the land of iPhones and iPads, iOS uses a variety of criteria to decide which networks to attach itself to automatically, including the network security settings and hotspot type. There's no easy way to set up 'preferred' networks using the default options you get with iOS.
There are a number of workarounds you can try, though none automatically detect signal strength. The first is to install WiFi Priority, which isn't quite as slick or as user-friendly as the apps on Android but does exactly what it promises it will. It lets you disable auto-join on certain networks, which in turn prioritises the alternatives whenever iOS is trying to connect. You can still connect to any network with a tap.
Another slightly long-winded way of achieving the same end result is to install Apple Configurator 2 on your Mac and create a customised iPhone profile from there (How-To Geek has a comprehensive guide to the process you can check out). As with WiFi Priority, you can disable the auto-join on certain networks, thus prioritising others.
Finally there's a tip shared on a blog by Nick Heer that says any WiFi preferences you set up on macOS will automatically sync across iCloud to iOS devices using the same Apple ID. You can prioritise certain networks through System Preferences on your Mac (as we've previously covered on Field Guide) and that should do the trick, though you might have to reset Network Settings first, and not everyone has been able to get this to work.