A sensor is a device which detects or measures a physical property and records, indicates, or otherwise responds to it when implanted in other device . There are many type of sensors are avaiable in the electronic devices to improve there intelligence . Gravity sensor is also a type of sensor . Gravity is attraction force of the earth for all physical things with having mass .Gravity sensing is used to measure or respond on change of center of gravity of the physical things.
In short It is just like accelerometer and they are measured along the X,Y, and Z axes.
When a device with gravity sensor is held up, the source of gravity acceleration is, of course, the gravity pull of the Earth. But the only difference between gravity sensor and accelerometer sensor gives sum of all forces applied to your device ,while the Gravity sensor return only the influence of gravity .
Understand with an example
To understand working of this sensor suppose you have a remote controlled car with gravity sensing function . You take the remote in you hand . Now center of gravity in fixed . To change the center of gravity you move the remote on left side . It detects the change of center of gravity and respond it as your car turns left side.
Gravity sensors are used in various type of different devices such and smartphones , electronic toys such as remote controlled cars and air plains ,cnc machines etc.