Heterogeneous wireless networks (HWNs) provide flexible and diversified wireless network access (e.g., cellular, IEEE 802.11) by integrating cellular networks, wireless LANs, and ad hoc networks with the Internet. It has been emerging as a promising solution to offer a variety of exciting applications, anytime and anywhere. The flexibility and benefits of the HWN, for example, is to extend the service coverage of the existing cellular and WLAN infrastructure, to improve the communication throughput, and reduce packet transmission latency, based on availability of different types of radio network in the roaming area (cellular, WLAN, or others). In the study, we answer some fundamental questions in the design and deployment of a HWN. The first is how to effectively operate a mobile terminal in ad hoc mode to access the Internet through a cellular network, WLAN or other underlying wireless access networks. The second is how to design ubiquitous seamless mobility support for a roaming user, allowing ubiquitous and bi-directional Internet accessibility, connectivity, and mobility. Finally, it answers the questions that what is the security threats for a mobile terminal that is operating in the ad hoc mode, and how to provide information confidentiality for a continuously moving mobile terminal.