We study the WiFi offloading problem in smart communications and adaptively seek for the optimal offloading strategies with the consideration of the mobility management and the dynamical nature of network state. With users mobility management, we formulate the offloading ratio optimization problem based on Markov process. Then, we propose a novel Congestion-Optimal WiFi Offloading (COWO) algorithm based on subgradient method, which aims to obtain the optimal offloading ratio for each access point (AP) to maximize the throughput and minimize the network congestion. Due to the computational complexity of subgradient method, we further improve the COWO algorithm by the equivalent transformation. By viewing all the APs as one virtual WiFi network, we try to optimize the identical offloading ratio for virtual WiFi network and develop a Virtualized Congestion-Optimal WiFi Offloading (VCOWO) algorithm with lower complexity. Under the equivalent conditions, the performance of the VCOWO algorithm could well approximate the optimal results obtained by the COWO algorithm. It is found that the VCOWO algorithm could obtain the upper bound of multiple APs WiFi offloading performance. Moreover, we investigate the impacts of user mobility on the WiFi offloading performance. Simulation results show that the proposed algorithm could achieve higher throughput with lower network congestion compared with other current offloading schemes.