In the evolving landscape of technology and smart devices, the focus on modeling spatial correlations, temporal dynamics, and friendship influence in point-of-interest (POI) check-ins has intensified. Existing works center on capturing user check-in behavior, emphasizing spatial and temporal dependencies of POIs. Markov chain-based methods address instance-level interactions, while recurrent neural network (RNN) approaches excel in handling variable-length check-in sequences. However, the former struggles with high-order POI transition dependency, and the latter cannot discern individual POI contributions in a historical check-in sequence. Additionally, RNNs propagate local and global information through a single bottleneck—hidden states. To address these limitations, a novel model is presented, enforcing contextual constraints on sequential data. The design incorporates spatial and temporal attention mechanisms over an RNN, highlighting the significance of POIs visited by users within specific time intervals and geographical distances during successive check-ins. The attention mechanism aids in identifying crucial POIs based on time difference and spatial distance in user check-in history for predicting the next POI. Periodicity and friendship influence are also considered in the model design. Experimental results on the BrightKite location-based social network demonstrate the proposed method's outperformance over existing state-of-the-art deep neural network methods for the next POI prediction and understanding of user transition behavior. Sensitivity analyses of parameters, including context windows for capturing sequential effects and estimating temporal and spatial attention, further validate the model's effectiveness. In parallel, this paper introduces a Space-Time Features-based Recurrent Neural Network (STF-RNN) for predicting individuals' next movements using mobility patterns from GPS device logs. Unlike traditional approaches, the STF-RNN automatically extracts internal representations of space and time features, enhancing efficiency in uncovering valuable insights into human behavior. Leveraging the sequence-representing ability of RNN structures, the model keeps track of user movement history, enabling the discovery of more meaningful dependencies and, consequently, improving performance. Collectively, these contributions advance the understanding and prediction capabilities in the realms of spatial dynamics, temporal dependencies, and human mobility patterns.