I am developing a website which need to get how much centimeters moved the phone and in which direction. I found the accelerometer and the gyroscope, but with the first one I only can see if the phone moves, and with the second one I can see which direction, that's ok, but I don't know how to get how much moved.
The very nature of the accelerometer means it will not be easy to calculate the distance moved. Basically you would need to write a differential equation that calculated the (3D) velocity of the phone after some kind of acceleration took place, and integrated that into a distance moved. The accuracy of the calculation would be very low without some kind of reference point and calibration of the accelerometer.
You would be better off querying the GPS to work out your new coordinates, but that's probably not that accurate either.