How to use Accelerometer to measure distance for Android Application Development
Solution 1:
You get position by integrating the linear acceleration twice but the error is horrible. It is useless in practice.
Here is an explanation why (Google Tech Talk) at 23:20. I highly recommend this video.
Similar questions:
track small movements of iphone with no GPS
What is the real world accuracy of phone accelerometers when used for positioning?
how to calculate phone's movement in the vertical direction from rest?
iOS: Movement Precision in 3D Space
Solution 2:
You can combine it with GPS positioning, and filter data with Kalman filter. GPS give rough but stable position, while accelerometer give more accerate but drifting position.