labexp / osmtracker-android

GPS tracking tool for OpenStreetMap
GNU General Public License v3.0
498 stars 234 forks source link

GPX export not working #443

Open Cigaes opened 2 months ago

Cigaes commented 2 months ago

Hi. Since F-Droid upgraded OSMTracker to 2024.07.09 (62), exporting to GPX no longer works. I get: “export process finished successfully” and the green light is shown, but no GPX file appears in the directory. The directory was set to /osmtracker, I tried changing it to /storage/emulated/0/osmtracker, to no avail. Android 13, LineageOS 20-20231222 Thanks in advance.

jer194 commented 2 months ago

In my case, exported GPX files go here: /sdcard/Android/data/net.osmtracker/files/osmtracker

The file location in 'settings' is ignored now, from what I have seen.

jamescr commented 2 months ago

Android had introduces changes in the way access to storage is managed. Android 10+ introduces scoped storage, the new normal location is Android/data/net.osmtracker/files/osmtracker.

The file location in settings is used after the location provided by Android, in example after "Android/data/net.osmtracker/files/" or "/sdcard/Android/data/net.osmtracker/files". If your file location in setting is "test" the export path will be "/sdcard/Android/data/net.osmtracker/files/test"

Something to consider is if it still makes sense the location in settings, because now OSMTracker files are separated from other apps files.

(duplicates issue #440)

Cigaes commented 2 months ago

Hi. Thanks for the reply. Indeed, I can access the files:

u0_a226@localhost ~ $ sudo ls /storage/emulated/0/Android/data/net.osmtracker/files/osmtracker/
2024-07-20_14-57-31_2024-07-20_14-57-31.gpx
2024-07-20_14-57-31_2024-07-20_14-57-311.gpx
2024-07-20_14-57-31_2024-07-20_14-57-312.gpx
u0_a226@localhost ~ $ sudo ls /sdcard/Android/data/net.osmtracker/files/osmtracker/
2024-07-20_14-57-31_2024-07-20_14-57-31.gpx
2024-07-20_14-57-31_2024-07-20_14-57-311.gpx
2024-07-20_14-57-31_2024-07-20_14-57-312.gpx

Unfortunately, that will not be the case for anybody:

u0_a226@localhost ~ $ ls /sdcard/Android/data/net.osmtracker/files/osmtracker/
ls: cannot access '/sdcard/Android/data/net.osmtracker/files/osmtracker/': Permission denied
zsh: exit 2     ls --color=tty -FT0 /sdcard/Android/data/net.osmtracker/files/osmtracker/
u0_a226@localhost ~ $ ls /storage/emulated/0/Android/data/net.osmtracker/files/osmtracker/     
ls: cannot access '/storage/emulated/0/Android/data/net.osmtracker/files/osmtracker/': Permission denied
zsh: exit 2     ls --color=tty -FT0 

It will require a solution for people who do not have a rooted phone.

I have found another work-around: “sharing” the GPX with Termux.

Vlado-99 commented 2 months ago

What is the meaning of export to directory where no other app has access? Can be possible to export into Downloads/osmtracker?

sandsturm commented 2 months ago

I have the same issue. I also saw #440 and the comments there and I have to say it is a bad UX if the normal export directory is not working anymore. I cannot access /sdcard/Android/data/net.osmtracker/ at all. My typical workflow was to export the gpx track from osmtracker and to upload it to either osm and/or bergfex. Since I mostly do this in my holidays, when I am hiking, I do not have a computer with adb with me.