-
Notifications
You must be signed in to change notification settings - Fork 126
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
Move the exportation folder to a location accessible with scoped storage #141
Comments
Dear @GrazianoCapelli I am also in the process of reading up on the (new) problem. I don't really understand this, because if the user is informed of the dangers every time the folder selection dialog is called and the download folder will be chosen and the user must confirm, as it's been the case before, he should aware what he is doing. This is also currently being discussed here too: osmdroid/osmdroid#1678 (comment) Of course, selecting a single file via the file dialog seems to be no problem, but accessing a whole folder for browsing purposes is now a big task :( |
I took some time to delve into the topic and to deepen what @WRPSoft suggested, and I got an idea of a possible approach to take. As a bonus, the users will be able to export the files into any desired folder, including Clouds / FTP / SDCard and so on. This approach works for Android 5.0+, because Time for ideas, comments, and suggestions! |
TO-DO LIST
WISHLIST
|
With the last commit I added the preference, the persistable permission and the fallback method for the old Android 4.X (I wouldn't drop it, the old Android 4 phones are very useful to be used as offline GPS loggers. And, last but not least, I have one of them :) ). Currently if you select the Download folder the app crashes on Export (to be fixed). I make some research, and I found that the support for Cloud services on Folder selection dialog is not yet supported by the cloud services like Drive or Dropbox. It will appear on dialog as soon as the cloud services will support it. |
The feature has been fully implemented, and will be deeply tested. |
The feature has been merged into the 'develop' branch, and will be included into the next v3.1.0. |
dear @WRPSoft,
These weeks I implemented the new exportation routine basing on Another big limitation of Anyway I don't see an alternative to that, thus Basic Air Data team is going straight with Scoped Storage, hoping on a better support in the future. |
P.S: To date we made no test with Cloud Roots. |
Starting in November 2021, app updates will be required to target API level 30 or above.
https://developer.android.com/distribute/best-practices/develop/target-sdk
The API level 30 force the Apps to switch to Scoped Storage.
https://developer.android.com/about/versions/11/privacy/storage
Apps that run on Android 11 but target Android 10 (API level 29, like GPS Logger today) can still request the
requestLegacyExternalStorage
attribute (GPS Logger does it). This flag allows apps to temporarily opt out of the changes associated with scoped storage, such as granting access to different directories and different types of media files. After you update your app to target Android 11, the system ignores therequestLegacyExternalStorage
flag.This means that
getExternalStorageDirectory
will be not usable anymore (like @WRPSoft rightly wrote on #130).If I understood correctly, the root folder of the device storage is not freely accessible anymore.
We have to to migrate the app files to locations that are accessible with scoped storage.
In this period we prepared the app to easily move the app's folders in a different place.
For the Share and the View intents (that are using the
Temp
subfolder now) the solution is simple, because we already use the FileProvider: we'll use the privateFilesDir
folder. TheTemp
folder will not be directly accessible again, but it is a minor issue.In the meanwhile we made some research in order to find a safer place for
/GPSLogger
folder (the public folder where the app exports the tracks to be picked by other apps or via USB), but we don't reached a solution yet.Where could we move the exporting folder when we'll switch to API 30?
The folder should be visible by all other apps, including File Browsers, and should be present on all the devices.
If someone has an idea, we would be glad to receive some suggestion.
The text was updated successfully, but these errors were encountered: