Measure the length of curves via a smartphone's accelerometer
Accelerometers and gyroscopes provide corrupted measures of the acceleration $a$ and angular velocity $\omega$. So, they need to be preprocessed in order to use them.
Firstly, measure provided by the accelerometer ($a'$) is affected by Earth gravity $g$ (in the local frame reference), a bias $b_g$ and some random noise $\eta_a$. So if the true acceleration is called $a$, one has that measure is:
$$ a' = a + g + b_a + \eta_a$$
So in order to integrate accelerometer measures, one should know at least $b_a$ and $g$ in the accelerometer frame, and subtract them from $a'$. Moreover, in some datasheets you can find covariance of $\eta_a$. However, bias is time dependent term and it needs to be estimated each time we initialize the system, as well as the gravity in the local frame. In some cases, if the movement is not in gravity direction (2D movement) and gravity is aligned to some accelerometer axis (lets say $z$ axis), one can neglect $a_z$ and the knowledge of $g$ is not required (maybe it is your case).
Secondly, gyroscope is also corrupted by bias $b_g$ and noise $\eta_g$. So, if the true angular speed is $\omega$, one has that the measure is:
$$ \omega' = \omega +b_g + \eta_g$$
Again, you need to know at least the gyro bias. and subtract it from the measure.
Everything becomes easier if your device has no bias or it can be neglected w.r.t $a$ and $\omega$, and your movement is 2D (gravity is always oriented in the same way).
So once that you have your corrected measures, you can integrate them to obtain the trajectory:
$$ R(t+\Delta t) = R(t) \exp(\omega \Delta t)$$
$$ p(t+\Delta t) = p(t) +v(0) t + \frac{1}{2}R(t)a(t)t²$$
Where $R$ is the rotation matrix (see rotation matrix) and $\exp$ is the exponential map (see exponential map). $v(0)$ is the initial speed.
It can be concluded that having a known initial speed, a 2D movement, and a low corrupted gyro/accelerometer, it can be easily estimated the trajectory.
Edit: Calibration (i.e. getting $g$, $b_a$ and $b_g$) can be intermediately done if device remains static. In this case, accelerometer gives $a' = g + b_a +\eta_a$ and gyro gives $\omega' = b_g + \eta_g$