This paper presents a pedestrian dead reckoning (PDR) approach based on motion mode recognition using a smartphone. The motion mode consists of pedestrian movement state and phone pose. With the support vector machine (SVM) and the decision tree (DT), the arbitrary combinations of movement state and phone pose can be recognized successfully. In the traditional principal component analysis based (PCA-based) method, the obtained horizontal accelerations in one stride time interval cannot be guaranteed to be horizontal and the pedestrian’s direction vector will be influenced. To solve this problem, we propose a PCA-based method with global accelerations (PCA-GA) to infer pedestrian’s headings. Besides, based on the further analysis of phone poses, an ambiguity elimination method is also developed to calibrate the obtained headings. The results indicate that the recognition accuracy of the combinations of movement states and phone poses can be 92.4%. The 50% and 75% absolute estimation errors of pedestrian’s headings are 5.6° and 9.2°, respectively. This novel PCA-GA based method can achieve higher accuracy than traditional PCA-based method and heading offset method. The localization error can reduce to around 3.5 m in a trajectory of 164 m for different movement states and phone poses.