Every mobile network uses cell towers to transfer data to mobile devices, and they all use a state machine to manage the radio resources efficiently.
This means that 3G, 4G HSPA+/LTE* and EVDO networks and technologies, regardless of the carrier, all run on some radio state machine.
Wi-Fi connections, on the other hand, are much more efficient from a battery and network perspective, because there is little latency for connection setup, and therefore no need for the state machine.
As a developer, you can use this to your advantage.
This Best Practice Deep Dive looks at some variations of the Wi-Fi 802.11 standard to show why they can be a good alternative for receiving data, and discusses the costs and benefits of using Wi-Fi in an application.
While 3G and 4G wireless networks are becoming faster and more ubiquitous, there are times when Wi-Fi is a good alternative for receiving data on a mobile device.
Wi-Fi is a wireless protocol based on the 802.11 standard that uses radio waves, just like mobile phones, except that Wi-Fi transmits at frequencies of 2.4 GHz or 5 GHz.
The 802.11 standard has several variations:
802.11a—This standard transmits at 5 GHz and can move up to 54 megabits of data per second. It uses orthogonal frequency-division multiplexing (OFDM), a more efficient coding technique that splits that radio signal into several sub-signals before they reach a receiver, which greatly reduces interference.
802.11b—This is the slowest and least expensive standard. For a while, its cost made it popular, but now it's becoming less common as faster standards become less expensive. 802.11b transmits in the 2.4 GHz frequency band of the radio spectrum. It can handle up to 11 megabits of data per second, and it uses complementary code keying (CCK) modulation to improve speeds.
802.11g—This standard transmits at 2.4 GHz like 802.11b, and it can handle up to 54 megabits of data per second. However, 802.11g is much faster than 802.11b because it uses the same OFDM coding as 802.11a.
802.11n—This is a newer standard that significantly improves speed and range. For instance, although 802.11g theoretically moves 54 megabits of data per second, it only achieves real-world speeds of about 24 megabits of data per second because of network congestion. 802.11n, however, reportedly can achieve speeds as high as 140 megabits per second.
Note: The speeds listed for these standards are Wi-Fi spec speeds. Actual speeds may vary and depend on device characteristics, network, network availability, coverage levels, tasks, file characteristics, applications and other factors.
Many applications do not take advantage of the fact that Wi-Fi connections can be much more efficient from a battery and network perspective than a cellular network, because there is less latency for connection setup. There are situations where offloading from cellular to Wi-Fi makes sense in an application.
Best Practice Recommendation
The Best Practice Recommendation is to offer your users the opportunity to connect to Wi-Fi when it is available.
Offloading to Wi-Fi offers several benefits:
- Lower data costs.
- Faster connections.
- Less battery drain.
- Improved network traffic.
- Improved customer experience.
- Shorter promotion delays allow content to appear much faster. Promotion delays (in the TCP handshake) drop from ~2 seconds to the millisecond timeframe.
However, there are costs to using Wi-Fi. On a mobile device, Wi-Fi has a greater impact on battery life. Extensive use of Wi-Fi can reduce energy faster than using 3G or 4G. If the Wi-Fi is only used occasionally, though, there will not be as big of an impact.
Weighing these benefits and costs, you can see that it makes sense to look for opportunities to use Wi-Fi to help users access data from your application.
Wi-Fi can especially benefit your app in the following situations:
- If your application requires near real-time interactions with a server, Wi-Fi may provide a better experience for your users.
- If you have a data heavy application, you can use the WifiManager (in Android) to scan for Wi-Fi networks, and offer your users the choice to switch off of the mobile network.
* Limited 4G LTE availability in select markets. 4G speeds delivered by LTE or HSPA+ with enhanced backhaul, where available. Deployment ongoing. Compatible device and data plan required. LTE is a trademark of ETSI. Learn more at att.com/network.