Nonadiabatic dynamics (NAMD) simulations have become powerful tools for elucidating complicated photoinduced processes in various systems from molecules to semiconductor materials. In this review, we present an overview of our recent research on photophysics of molecular systems and periodic semiconductor materials with the aid of ab initio NAMD simulation methods implemented in the generalized trajectory surface-hopping (GTSH) package. Both theoretical backgrounds and applications of the developed NAMD methods are presented in detail. For molecular systems, the linear-response time-dependent density functional theory (LR-TDDFT) method is primarily used to model electronic structures in NAMD simulations owing to its balanced efficiency and accuracy. Moreover, the efficient algorithms for calculating nonadiabatic coupling terms (NACTs) and spin-orbit couplings (SOCs) have been coded into the package to increase the simulation efficiency. In combination with various analysis techniques, we can explore the mechanistic details of the photoinduced dynamics of a range of molecular systems, including charge separation and energy transfer processes in organic donor-acceptor structures, ultrafast intersystem crossing (ISC) processes in transition metal complexes (TMCs), and exciton dynamics in molecular aggregates. For semiconductor materials, we developed the NAMD methods for simulating the photoinduced carrier dynamics within the framework of the Kohn-Sham density functional theory (KS-DFT), in which SOC effects are explicitly accounted for using the two-component, noncollinear DFT method. Using this method, we have investigated the photoinduced carrier dynamics at the interface of a variety of van der Waals (vdW) heterojunctions, such as two-dimensional transition metal dichalcogenides (TMDs), carbon nanotubes (CNTs), and perovskites-related systems. Recently, we extended the LR-TDDFT-based NAMD method for semiconductor materials, allowing us to study the excitonic effects in the photoinduced energy transfer process. These results demonstrate that the NAMD simulations are powerful tools for exploring the photodynamics of molecular systems and semiconductor materials. In future studies, the NAMD simulation methods can be employed to elucidate experimental phenomena and reveal microscopic details as well as rationally design novel photofunctional materials with desired properties.