I had to make my own GPS simulator for Android and iOS

Friday, March 10, 2023

Last weekend I tested the new version of GPX One. Without success. Predicting the position caused the blue marker to jump in all directions. The version you are using now works much better (despite the current position being 10 seconds behind).

The cause is the inability to properly test varying speeds. If you always drive exactly 50 km/h in the simulation, the prediction is simple. In real life you never drive exactly 50, sometimes 51 then again 48 etc. This meant that my focus had to be better simulation and testing this week.

I write the technical story below. If you don't find that interesting, feel free to skip it. There will be a new version next week. If necessary, I will turn off the prediction of your location for a while.

Routing simulation

The tricky thing about testing GPX One is that every time I have to let my girlfriend do a lap. I can then operate the app. Changing code in the car is difficult, so you have to do it at home. Then back in the car, repeat. The best thing is if this can be tested on the computer first. This way I can first simulate and only then test in the car.

I have recorded several routes with a GPS logger so that I can play and test them in the phone. At least that was my expectation. It turns out that these apps all use a fixed speed. This means you always drive at the same speed. This does not match how we drive on the road.

The timestamps are recorded in the GPS log files. So I know exactly how much time there is between two measurements, and therefore the speed. After trying several programs without success, I decided to write my own simulation software.

GPS simulator
GPS simulator sending fake GPS signals to phone

Above you can see the computer sending varying coordinates and speeds to my Android device. Now I can simulate routes much more accurately. In addition, I can easily replay parts where something goes wrong.

So the week turned out a little different than planned, but this GPS tool is really super valuable for the future 🚀


⇦ An attempt for better user position estimation

Snapping the user position to route ⇨