Half of the solution at least on Android is
https://gpslogger.app. Then you need to find a way to render the data to a map, such as with
https://dawarich.app. Looks like the last time I looked at that project (and wasn't quite sold on it) was 1.5 years ago, so time for a second look.