Hi.
How can I know what’s files in [system.DocumentsDirectory]?
I want get files name list at directory (at Android SD card). thanks. [import]uid: 10780 topic_id: 9196 reply_id: 309196[/import]
What is in “DocumentsDirectory”? Whatever you put inside. There is nothing else, as your application is sandboxed.
To answer your quesiton, no there is now way to access the list of files inside a directory. And frankly, there is absolutely no need to. [import]uid: 51516 topic_id: 9196 reply_id: 33554[/import]
thank you for your reply.
I want access Android SD card Directory.
I want get picture file list there are take by digital camera.
Can I get these? [import]uid: 10780 topic_id: 9196 reply_id: 33678[/import]
@dora1999 Are you taking a picture with the camera in your app, or just trying to get to the Sd card for a file you think might exist?
Oh and I can think of a few reasons why I would want a file list of what is in a directory… [import]uid: 37036 topic_id: 9196 reply_id: 33697[/import]
Hi.
Yes I want take file list at [trying to get to the Sd card for a file].
Other Camera device’s picture files I want to copy for my App.
[import]uid: 10780 topic_id: 9196 reply_id: 33699[/import]
frankly, there is absolutely no need to.
There’s no need to list the files in your documents directory because the only files in there are the ones you put there. However if you can access other directories (I know nothing about that) then a file list would be very helpful. [import]uid: 12108 topic_id: 9196 reply_id: 33741[/import]
Not so if you have document sharing enabled.
My app allows users to create drum presets. So when I update the app, there may be lots of new presets which have to folded into the master list of presets for the app. If anybody can think of a way to do this, it would be huge for me.
[import]uid: 56133 topic_id: 9196 reply_id: 71422[/import]
re: “there is absolutely no need to” (not picking, just refuting)
It is perfectly reasonable to do this. Not sure about Android, but in iOS the users can add and delete documents in the app’s Documents directory through iTunes. So how do you know what’s in there if the user can change it? Answer: you need to be able to list the contents.
For several other reasons, it would be really useful to get the contents of a directory. The device-wide “photos” directory is a good example. You can’t just guess at what photos might be there and what their names are.
I assume that what people are doing right now is storing the app’s Documents directory structure in a file, updating when files are added and removed? That seems to duplicate what the file system already does. Also, I don’t see why you need to load all those file records in memory when you could just query the contents of a directory with the os. It’s basic operating system functionality.
I’m hoping there’s some new information on this, or a workaround. Maybe a way to write a plugin if it requires a native element? Anyone know? [import]uid: 112472 topic_id: 9196 reply_id: 76070[/import]
I was looking forward to doing just this.
I plan to allow people to download files from my web site, and to let them work on created files in other apps.
Ive seen apps get around this by having ‘slot1’, ‘slot2’ etc, which works for saved games, but is clumsy for document apps.
Off topic: how do you get an app to be recognised as one which can share documents with the Mac through iTunes (on my iPad only Garageband and an Office App do that)?
[import]uid: 108660 topic_id: 9196 reply_id: 76071[/import]
@jeff472 on iOS add the property UIFileSharingEnabled set to true in the app’s info.plist. [import]uid: 112472 topic_id: 9196 reply_id: 76072[/import]
It took a few minutes to see how that was done.
I find:
iphone =
{
plist =
{
UIFileSharingEnabled = true,
}
}
is the way.
So thats a little chip in the process, thanks!
[import]uid: 108660 topic_id: 9196 reply_id: 76076[/import]
I have a need to get a list of files. I want to load an array with a list of filenames in one of my directories so I can make decisions on how to handle those files based on their filename. [import]uid: 125260 topic_id: 9196 reply_id: 89471[/import]