Four-dimensional printing (4DP) technologies are revolutionizing the fabrication, functionality, and applicability of stimuli-responsive analytical devices. More practically, 4DP technologies are effective in fabricating devices with complex geometric designs and functions, and the degree of shape programming of 4D-printed stimuli-responsive devices can be optimized to become a reliable analytical strategy. Although shape-programming modes play a critical role in determining the analytical characteristics of 4D-printed stimuli-responsive sensing devices, the effect of shape-programming modes on the analytical performance of 4D-printed stimuli-responsive devices remains an unexplored subject. We employed digital light processing three-dimensional printing (3DP) with acrylate-based photocurable resins and 2-carboxyethyl acrylate (CEA)-incorporated photocurable resins for 4DP of the bending, helixing, and twisting needles. Upon immersion in samples with pH values above the pKa of CEA, the electrostatic repulsion among the dissociated carboxyl groups of polyCEA caused swelling of the CEA-incorporated part and [H+]-dependent shape programming. When coupling with the derivatization reaction of the urease-mediated hydrolysis of urea, the decline in [H+] induced shape programming of the needles, offering reliable determination of urea based on the shape-programming angles. After optimizing the experimental conditions, the helixing needles provided the best analytical performance, with the method's detection limit of 0.9 μM. The reliability of this analytical method was validated by determining urea in samples of human urine and sweat, fetal bovine serum, and rat plasma with spike analyses and comparing these results with those obtained from a commercial assay kit. Our demonstration and analytical results suggest the importance of optimizing the shape-programming modes to improve the analytical performance of 4D-printed stimuli-responsive shape-programming sensing devices and emphasize the benefits and applicability of 4DP technologies in advancing the development and fabrication of stimuli-responsive sensing devices for chemical sensing and quantitative chemical analyses.