-
Notifications
You must be signed in to change notification settings - Fork 173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changed default path for custom navit.xml #907
Comments
I agree that a smooth upgrade path from the current folders would be a good thing. Otherwise, existing users may struggle to find the (easy) solution to recover a working map at startup. |
Also, from my tests, it seems that an automatic check of /sdcard/navit is really required because each time I re-install a test application built on my machine, I loose the manually setup map location and I have to do it again after launching the new compiled app. |
As @jandegr pointed out in #890, Android 10 (Q; API 29) introduces scoped storage. In a nutshell:
This means that shared external storage and portability do not go well together. Then again, Navit could easily move things to private storage (internal or external) and continue addressing files via filesystem paths. We can now do the following:
Further reading: |
Hi, The only long-term solution I could think of (and briefly tested) is to select a path with So what would work is to copy files into the private storage folder, but that can already be done with android's own file explorer. |
@jandegr Could we make this work for devices down to our current minsdk version? |
After updating to Android 10 and running into this pitfall, I would recommend the following course of action:
sure it can be done that way, but that’s a bit like shorting your car to start it, rather than using the ignition key… not exactly the UX I would expect. |
According to information on the net, Android 11 reversed the previous decision of locking apps out of the file system, see https://stackoverflow.com/questions/60360368/android-11-r-file-path-access and https://stackoverflow.com/questions/62782648/android-11-scoped-storage-permissions/66366102#66366102. A new permission may need to be requested, as far as I can see it. After upgrading to Android 11, however, Navit is no longer seeing any of my local files (navit.xml or maps), which are in /sdcard/Android/data/org.navitproject.navit/files. Haven’t quite figured out why this isn’t working. |
i got similar user issues via mail, also couldn't figure it out so far |
I’ve opened a new issue #1117 with everything I have been able to collect so far. |
This came out of discussion in #904:
#877 changes the default path in which Navit looks for a custom
navit.xml
on Android.Prior to #877, one could place a custom
navit.xml
into/sdcard/navit/
and Navit would use that; this was also the path where Navit would look for maps and store downloaded maps.#877 changes that: the default path for
navit.xml
and maps is now/data/data/org.navitproject.navit
, the app’s private data dir, not accessible from a connected PC. However, there is now a preference to change that path—one can easily change that to/sdcard/navit
(or anything else), which takes a one-time manual step.TL;DR: does everyone agree that we should keep it that way, or should we tackle this differently?
The rationale behind this is that
/sdcard/navit
requires special permission to access, which the user needs to grant manually on later versions of Android. The new default eliminates that need for users who just download maps and are not customizing navit.xml.@jandegr furthermore writes:
I’d like to put that up for discussion. Essentially, we have three options:
Option 1: Shared storage (usually
/sdcard/navit
)This is the previous behavior.
Pros:
/sdcard
device or partition, this is usually the largest partition (important as map files for bigger areas are quite large)Cons:
/sdcard
is FAT-formatted), file size is limited to 2 GB (and map files can easily get bigger than that)Pros or cons (depending on your point of view):
Option 2: External storage (usually
/sdcard/Android/data/org.navitproject.navit
)Pros:
/sdcard
device or partition, this is usually the largest partitionCons:
/sdcard
is FAT-formatted), file size is limited to 2 GB (and map files can easily get bigger than that)Pros or cons (depending on your point of view):
Option 3: Internal storage (usually
/data/data/org.navitproject.navit
)Pros:
/sdcard
is FAT-formatted), file size is not limited to 2 GB (though the whole partition might not be that large)Cons:
/sdcard
device or partition, this is usually the smaller partition and might not be big enough for map filesPros or cons (depending on your point of view):
Variations of the above:
navit.xml
, another one for map datanavit.xml
(ordered list of the above options): if nothing is found in one path, look in the next@jandegr, what did you mean by:
—that it might not work? Or that it definitely won’t? (I have not yet seen a device where
/sdcard
is not accessible even for apps with shared storage permission, but I certainly may have missed something.)Currently I am gravitating towards option 2, as it makes data manipulation from a PC easier. We might add an automatic fallback to
/sdcard/navit/
for navit.xml if it is not found in the first path, to avoid breaking compatibility with older setups. (Right now, upgrading from pre-#877 to post-#877 will render Navit useless until the user figures out they have to set the path manually).The text was updated successfully, but these errors were encountered: