With the rapid development of smartphone technology, pedestrian navigation based on built-in inertial sensors in smartphones shows great application prospects. Currently, most smartphone-based pedestrian dead reckoning (PDR) algorithms normally require a user to hold the phone in a fixed mode and, thus, need to correct the gyroscope heading with inputs from other sensors, which restricts the viability of pedestrian navigation significantly. In this paper, in order to improve the accuracy of the traditional step detection and step length estimation method for different users, a state transition-based step detection method and a step length estimation method using a neural network are proposed. In order to decrease the heading errors and inertial sensor errors in multi-mode system, a multi-mode intelligent recognition method based on a neural network was constructed. On this basis, we propose a heading correction method based on zero angular velocity and an overall correction method based on lateral velocity limitation (LV). Experimental results show that the maximum positioning errors obtained by the proposed algorithm are about 0.9% of the total path length. The proposed novel PDR algorithm dramatically enhances the user experience and, thus, has high value in real applications.