documentfile Questions
3
Solved
I'm trying to check if a file exists prior to creating it, using DocumentFile (due to the Storage Access Framework). But DocumentFile().fromTreeUri() removes the non-existant portion of the would-b...
Apogamy asked 2/8, 2018 at 20:6
2
Solved
I'm trying to walk an Android DocumentFile tree recursively but I cannot get a list of files to be returned for a subfolder. When I attempt listFiles() on the folder URI, I get the list of root fil...
Discomfort asked 28/8, 2021 at 3:12
2
Imaging, you want to check if "/folder/subfolder/subsubfolder/test/test.txt" file exits, you would do following:
DocumentFile sdCard = ...; // i have already retrieved the sd card root with the us...
Matthews asked 22/6, 2016 at 11:13
4
Solved
For Android, the following code returns a Uri that can be used to create DocumentFile corresponding to a directory.
Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT_TREE);
startActivityForRes...
Fascicule asked 19/9, 2016 at 16:20
2
In my app I gain sd card write permission using the following intent. If the user selects the sd card folder from the system file explorer then I have sd card write access.
Intent intent = new In...
Sclerodermatous asked 27/3, 2016 at 0:3
6
Alright, I've searched and searched and no one has my exact answer, or I missed it. I'm having my users select a directory by:
Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT_TREE);
startAc...
Briefing asked 21/1, 2016 at 15:29
1
Background
I have a few apps that make heavy use of SD card for file syncing. The broken external SD card access on Kitkat is still a big problem, but I am trying to resolve this with the new API ...
Allyn asked 3/1, 2015 at 21:52
1
Solved
TL:DR; I explained how to use create folders and subfolders using DocumentFile and how to delete file created using this class. Uri returned from onActvityResult() and documentFile.getUri.toString(...
Burp asked 20/9, 2017 at 15:17
2
I want to copy or move files from the internal storage to the sd card. I do this via the Storage Access Framework (SAF) and the DocumentFile class...
Copying is stream based and the DocumentFile d...
Carbolize asked 2/3, 2016 at 10:33
1
I have a DocumentFile defined in following two ways:
DocumentFile documentFile;
Uri documentFileUri;
I can delete a document file from the sd card via following methods:
documentFile.delete();...
Detrain asked 6/3, 2016 at 20:27
2
i am trying to list files in external storage devices on my android 5.1 phone using DocumentFile
String rootPathURI = "file:/media/storage/sdcard1/data/example.externalstorage/files/";
File f = ...
Lamere asked 26/7, 2016 at 13:14
3
Background
On Android 4.4 (KitKat), Google has made access to the SD card quite restricted.
As of Android Lollipop (5.0), developers can use a new API that asks the user to confirm to allow acces...
Blakeslee asked 4/11, 2014 at 20:54
1
Solved
After a lot of findings about how to write(and rename) a file in SD Card (android 5 and above), I think the new SAF provided by android will be required to take permission from user to write SD car...
Gloriagloriana asked 26/4, 2016 at 10:46
2
background
Starting with Lollipop, apps can get access to real SD-cards (after it was not accessible on Kitkat, and was not officially supported yet worked on previous versions), as I've asked abo...
Indecorum asked 27/7, 2015 at 19:53
1
Background
Starting from API 21 (Lollipop), apps can get a special "permission" to modify real SD-cards, as shown on previous posts I've written (here and here).
The problem
I can delete files, ...
Endothelium asked 14/8, 2015 at 22:54
1
Solved
My application uses Java class RandomAccessFile to read/write bytes to a file on SD card randomly by means of realization of SeekableByteChannel interface. Now I need rewrite it for Android 5.0 wit...
Stew asked 24/2, 2015 at 14:19
0
Background:
Using: ACTION_OPEN_DOCUMENT_TREE + DocumentFile
More on:
How to use the new SD card access API presented for Android 5.0 (Lollipop)?
I would like to ask:
I cannot find the way how to ch...
Zabaglione asked 18/12, 2014 at 16:0
1
© 2022 - 2024 — McMap. All rights reserved.