In GSM, the distance from the mobile station to the active cell tower is one of the main connection parameters. It is called Timing> (TA).
Please note: the active mast is usually the closest, but not always.
The TA value is usually from 0 to 63, with each step being a step forward for one bit period (approximately 3.69 ΞΌs). For radio waves traveling at a speed of about 300,000,000 meters per second (i.e., 300 meters per microsecond), one TA step then represents a change in the round-trip distance (twice the propagation range) of about 1,100 meters. This means that the TA value changes for each change of 550 meters in the range between the mobile and base stations.
That is, the distance to the current tower is always known to the mobile station with an accuracy of 550 meters.
This option should be easily accessible through the standard Android API.
source share