Comments (5)
from fuck-storage-access-framework.
Just FYI there is a test app that is also a sample app where you can find some info: https://github.com/K1rakishou/Fuck-Storage-Access-Framework/tree/develop/fsaf_test_app
What I want
- app launch
- ask permission for storage
- create a folder in root directory
- RxDownloader will emit a file (from temp storage) I want to save that
Basically you need to create FileChooser
and then call fileChooser.openChooseDirectoryDialog()
. This will request the user to select a directory where you will be able to store any kind of files until the user either uninstalls the app, revokes the permission or deletes the directory manually. Permissions will be requested automatically. Then in the onResult
callback you do
val rootDir = fileManager.fromUri(uri)
You may probably want to also persist that uri somewhere (shared prefs) so you don't have to request it every time.
And then you can do whatever you want. Here is how you can create a file inside that directory:
val file = fileManager.create(rootDir, FileSegment("file1.txt"))
assert("file1.txt", fileManager.getName(file))
from fuck-storage-access-framework.
If I understand the questions correctly:
- You can use FileManager.fromPath()/FileManager.fromRawFile() and pass there any path or file. The SAF alternative is fileManager.fromUri().
- I think SAF grants the permission for the whole directory and all sub-directories/files.
- https://github.com/K1rakishou/Fuck-Storage-Access-Framework#creating-a-new-file-or-directory
from fuck-storage-access-framework.
from fuck-storage-access-framework.
I guess this issue is resolved.
from fuck-storage-access-framework.
Related Issues (20)
- Implement "isChildOfDirectory()" method HOT 1
- Add "Name may contain an extension" comment HOT 1
- Should be "Snapshot" instead of "withSnapshot " HOT 1
- Research the possibility of making the ExternalFileManager faster by caching the CachingDocumentFile inside the ExternalFile and passing them down with every other operation
- Crash "too many SQL variables" HOT 3
- NPE in SAFHelper.listFilesFast HOT 3
- kotlin.NotImplementedError: Not implemented for com.github.k1rakishou.fsaf.file.ExternalFile, fileManagerId = FileManagerId(id='ExternalFile') HOT 1
- java.lang.IllegalArgumentException: Parent document isn't a directory HOT 1
- java.lang.IllegalStateException: Failed to touch /storage/emulated/0/Kuroba (1)/1557043536290.jpg: java.io.IOException: No such file or directory HOT 1
- Crash "java.lang.IllegalStateException: create() root is already FileRoot, cannot append anything anymore, root = /storage/emulated/0/Android/data/com.github.adamantcheese.chan/cache/filecache/b242d2460781b1e813c50efa4e9cc1ac.cache, baseDir segments = , segments = " HOT 1
- [Question] How to get fullPath without creating the File Itself? HOT 2
- [Question/Discussion] How to use SAF uriStrings to request a MediaStore scan? HOT 4
- SnapshotFileManager findFile and listFiles return null HOT 5
- createSnapshot takes a lot of time HOT 1
- dependency for build.gradle doesn't seem correct HOT 4
- Right way to share the path to DownloadManager... HOT 2
- How to keep special character when create dir with Storage-Access-Framework? HOT 6
- the function isAlreadyRegistered has a mistake HOT 1
- Comment is outdated HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fuck-storage-access-framework.