An anti-shaking method for use by a mobile phone in image capturing, wherein the anti-shaking method comprises the following steps of: A. initiating an anti-shaking operation mode of the gravity sensor module by depressing a shutter button on the mobile phone, entering an early stage of the image capturing process, using a gravity sensor module of the mobile phone to detect a shaking level of the mobile phone before capturing an image, detecting shaking vectors in different directions before the image capturing process and calculating an absolute value of a sum of the shaking vectors, determining the shaking level before the image capturing process according to the absolute value, the early stage of the image capturing process refers to a time period from depression of the shutter button to the beginning of the exposure of the image; B. according to the shaking level detected by the gravity sensor module, controlling an exposure time of the mobile phone in the process of capturing the image so that a camera module of the mobile phone captures the image according to the exposure time (S103,S104a); according to gravity acceleration values of the gravity sensor along three axes and the exposure time, calculating a displacement vector generated due to the shaking during the exposure time using a specific algorithm (S104b), and C. entering a later stage of the image capturing process, using an image processing software program to carry out deblurring processing on the blurred image according to a displacement vector generated due to shaking, the later stage of the image capturing process refers to a time period from exposure of the image to completion of the image processing. A. initiating an anti-shaking operation mode of the gravity sensor module by depressing a shutter button on the mobile phone, entering an early stage of the image capturing process, using a gravity sensor module of the mobile phone to detect a shaking level of the mobile phone before capturing an image, detecting shaking vectors in different directions before the image capturing process and calculating an absolute value of a sum of the shaking vectors, determining the shaking level before the image capturing process according to the absolute value, the early stage of the image capturing process refers to a time period from depression of the shutter button to the beginning of the exposure of the image; B. according to the shaking level detected by the gravity sensor module, controlling an exposure time of the mobile phone in the process of capturing the image so that a camera module of the mobile phone captures the image according to the exposure time (S103,S104a); according to gravity acceleration values of the gravity sensor along three axes and the exposure time, calculating a displacement vector generated due to the shaking during the exposure time using a specific algorithm (S104b), and C. entering a later stage of the image capturing process, using an image processing software program to carry out deblurring processing on the blurred image according to a displacement vector generated due to shaking, the later stage of the image capturing process refers to a time period from exposure of the image to completion of the image processing.