...
Device A - Samsung Galaxy S8 running Android 9
Device B - Google Pixel 3a running Android 10
Linux system acting as server endpoint (phones connected via USB)
Limitations
As there is no internet deployed back-end, the devices needed to be USB connected, which limited the testing range.
Human error in distance measurement +/- 2cm
Only Android and two types of device used
The phones remained flat, although it is known that tilting the phone changes the outputs
Method
Built and installed APK via USB to both phones
Over 45 minutes (with a tape measure) moving the two devices running the app around at distances between 0 and 320cm (changing distance every two minutes)
Extracted the readings from the phone databases manually (method)
Results
Device A
[{""latitude"":41.3986053,""longitude"":2.159144,""time"":1588416619345},{""latitude"":41.39861143255973,""longitude"":2.1591758894271402,""time"":1588416964271},{""latitude"":41.3986111,""longitude"":2.1591477,""time"":1588417382311},{""latitude"":41.39884529419205,""longitude"":2.1591677377011083,""time"":1588417707904},{""latitude"":41.39824724790695,""longitude"":2.1587165941002344,""time"":1588418190144},{""latitude"":41.398746510869785,""longitude"":2.1590672619422353,""time"":1588418516542}]
UPDATE catalystlocalstorage SET value = "[{""x"":138.1199951171875,""y"":84.77999877929688,""z"":-25.68000030517578,""timestamp"":1588416628368},{""x"":142.0800018310547,""y"":84.18000030517578,""z"":-26.69999885559082,""timestamp"":1588416678417},{""x"":141.4199981689453,""y"":83.93999481201172,""z"":-26.34000015258789,""timestamp"":1588416728419},{""x"":141.83999633789062,""y"":81.47999572753906,""z"":-27.35999870300293,""timestamp"":1588416778419},{""x"":141.4199981689453,""y"":81.9000015258789,""z"":-27.299999237060547,""timestamp"":1588416828618},{""x"":143.63999938964844,""y"":78.18000030517578,""z"":-30.119998931884766,""timestamp"":1588416878621},{""x"":141.3000030517578,""y"":79.5,""z"":-28.739999771118164,""timestamp"":1588416928819},{""x"":141.77999877929688,""y"":79.55999755859375,""z"":-28.439998626708984,""timestamp"":1588416978919},{""x"":147.72000122070312,""y"":114,""z"":-15.839999198913574,""timestamp"":1588417029116},{""x"":147.59999084472656,""y"":113.27999877929688,""z"":-15,""timestamp"":1588417079309},{""x"":152.27999877929688,""y"":99.29999542236328,""z"":-43.31999969482422,""timestamp"":1588417129503},{""x"":152.75999450683594,""y"":100.6199951171875,""z"":-45.05999755859375,""timestamp"":1588417179694},{""x"":188.39999389648438,""y"":111.41999816894531,""z"":-21.84000015258789,""timestamp"":1588417229886},{""x"":188.8199920654297,""y"":109.25999450683594,""z"":-21.059999465942383,""timestamp"":1588417280083},{""x"":188.22000122070312,""y"":108.18000030517578,""z"":-19.68000030517578,""timestamp"":1588417330253},{""x"":189.77999877929688,""y"":97.5,""z"":-16.85999870300293,""timestamp"":1588417380449},{""x"":190.3199920654297,""y"":98.69999694824219,""z"":-16.139999389648438,""timestamp"":1588417430644},{""x"":179.87998962402344,""y"":93.95999908447266,""z"":-4.980000019073486,""timestamp"":1588417480842},{""x"":185.6999969482422,""y"":94.13999938964844,""z"":-1.9199999570846558,""timestamp"":1588417531037},{""x"":187.97999572753906,""y"":91.37999725341797,""z"":-4.679999828338623,""timestamp"":1588417581227},{""x"":3.5399999618530273,""y"":6.899999618530273,""z"":58.2599983215332,""timestamp"":1588417631422},{""x"":2.6399998664855957,""y"":5.579999923706055,""z"":56.69999694824219,""timestamp"":1588417681616},{""x"":181.44000244140625,""y"":100.73999786376953,""z"":-22.68000030517578,""timestamp"":1588417731688},{""x"":175.0800018310547,""y"":105.5999984741211,""z"":-22.079999923706055,""timestamp"":1588417781885},{""x"":174.4199981689453,""y"":105.1199951171875,""z"":-21.600000381469727,""timestamp"":1588417832080},{""x"":173.45999145507812,""y"":104.87999725341797,""z"":-21,""timestamp"":1588417918398},{""x"":172.86000061035156,""y"":105.83999633789062,""z"":-20.939998626708984,""timestamp"":1588417968588},{""x"":172.9199981689453,""y"":104.87999725341797,""z"":-22.559999465942383,""timestamp"":1588418018786},{""x"":173.5800018310547,""y"":105.29999542236328,""z"":-24.719999313354492,""timestamp"":1588418068972},{""x"":175.25999450683594,""y"":104.39999389648438,""z"":-25.559999465942383,""timestamp"":1588418119165},{""x"":173.51998901367188,""y"":106.43999481201172,""z"":-22.739999771118164,""timestamp"":1588418169165},{""x"":173.94000244140625,""y"":105.65999603271484,""z"":-22.920000076293945,""timestamp"":1588418219361},{""x"":172.0800018310547,""y"":106.68000030517578,""z"":-22.020000457763672,""timestamp"":1588418269364},{""x"":172.55999755859375,""y"":106.31999969482422,""z"":-21.119998931884766,""timestamp"":1588418319386},{""x"":172.739990234375,""y"":106.86000061035156,""z"":-19.619998931884766,""timestamp"":1588418369389},{""x"":173.8199920654297,""y"":106.43999481201172,""z"":-22.19999885559082,""timestamp"":1588418419403},{""x"":172.9199981689453,""y"":105.89999389648438,""z"":-21.65999984741211,""timestamp"":1588418469411},{""x"":172.55999755859375,""y"":106.91999816894531,""z"":-21.420000076293945,""timestamp"":1588418519594},{""x"":173.39999389648438,""y"":106.37999725341797,""z"":-23.51999855041504,""timestamp"":1588418569787},{""x"":174.239990234375,""y"":107.04000091552734,""z"":-22.260000228881836,""timestamp"":1588418619979},{""x"":172.13999938964844,""y"":106.91999816894531,""z"":-20.939998626708984,""timestamp"":1588418670168},{""x"":171.4199981689453,""y"":107.15999603271484,""z"":-18.779998779296875,""timestamp"":1588418720361},{""x"":171.3000030517578,""y"":106.97999572753906,""z"":-20.15999984741211,""timestamp"":1588418770550},{""x"":177.95999145507812,""y"":101.69999694824219,""z"":-20.8799991607666,""timestamp"":1588418820747},{""x"":178.1999969482422,""y"":99.83999633789062,""z"":-20.760000228881836,""timestamp"":1588418870937},{""x"":178.8000030517578,""y"":100.07999420166016,""z"":-22.079999923706055,""timestamp"":1588418921129},{""x"":178.0800018310547,""y"":100.43999481201172,""z"":-19.3799991607666,""timestamp"":1588418971327},{""x"":166.9199981689453,""y"":109.13999938964844,""z"":-21.239999771118164,""timestamp"":1588419021524},{""x"":167.63999938964844,""y"":109.07999420166016,""z"":-20.760000228881836,""timestamp"":1588419071719},{""x"":167.16000366210938,""y"":109.37999725341797,""z"":-19.439998626708984,""timestamp"":1588419121911},{""x"":166.55999755859375,""y"":108.18000030517578,""z"":-20.69999885559082,""timestamp"":1588419172101}]" WHERE key = "MAGNETOMETER_DATA"
Device B
UPDATE catalystlocalstorage SET value = "[{""latitude"":41.39866657,""longitude"":2.15920166,""time"":1588412923000},{""latitude"":41.39862513,""longitude"":2.15911654,""time"":1588413236000},{""latitude"":41.39863124,""longitude"":2.15938479,""time"":1588413834000},{""latitude"":41.39856103,""longitude"":2.15917508,""time"":1588414431000},{""latitude"":41.39856103,""longitude"":2.15917508,""time"":1588414731000},{""latitude"":41.39856103,""longitude"":2.15917508,""time"":1588415031000},{""latitude"":41.3986023,""longitude"":2.1591289,""time"":1588415371000},{""latitude"":41.39861099,""longitude"":2.15937557,""time"":1588415933000},{""latitude"":41.39849698,""longitude"":2.15914064,""time"":1588416364000},{""latitude"":41.39882469,""longitude"":2.15917686,""time"":1588416665000},{""latitude"":41.39879951,""longitude"":2.15900525,""time"":1588416967000},{""latitude"":41.39859947,""longitude"":2.15909374,""time"":1588417274000},{""latitude"":41.39873588,""longitude"":2.15917513,""time"":1588417863000},{""latitude"":41.39862908,""longitude"":2.15938903,""time"":1588418179000},{""latitude"":41.39866785,""longitude"":2.15910249,""time"":1588418778000},{""latitude"":41.39855966,""longitude"":2.15911052,""time"":1588419089000},{""latitude"":41.39860547,""longitude"":2.15920427,""time"":1588419687000}]" WHERE key = "LOCATION_DATA"
...
For some hours, measurements continued to be collected indoors, although distances were not measured.
Observations & Analysis
It is notable that no new permissions were requested by the phone.
In terms of the results, this requires data science support. The x,y,z points need to be transformed to a value that should correlate with distance. See work to prepare the data here: https://github.com/AdamLeonSmith/privkittools/blob/master/Magnetometer.ipynb
Detailed Results
See attached files for the measurement data.