views:

151

answers:

2

Is it possible to read the file system beyond the application sandbox? Not the area for other applications, but folders like photos, video, music etc.

Would the "Assets Library Framework" help in this case? Can I use a file:/// NSURL etc.? The UIImagePickerController is a facade, it has hidden away all the details.

+1  A: 

I'm afraid not. For videos and music managed by iPod application, use Media Player Framework to get MPMediaItems. From an MPMediaItem you can get an AVAsset, see AVFoundation framework. You can get the URL of an AVAsset, but it's not a file path.

Similarly for photos and videos in Photo application, you use what you found, ALAssets. Again it doesn't give you the file URL.

Yuji
Yuji, Thanks for your comments. I think it should be possible to monitor, either through a polling custom code snippet or by using a provided listener, any changes to the list of items. The AL Asset API does provide metadata which may give timestamp, size, geo-location etc. for the
We can get a URL to images/videos etc though, using the following code: CFURLRef url = CFURLCreateFromFileSystemRepresentation (kCFAllocatorDefault, (const UInt8 *)inputFileName, strlen(inputFileName), false)
Yes you can, if you have images/videos **in your sandbox**.
Yuji
A: 

If the files you are referring to are images and videos from your phone's photo gallery then it is possible to access them with the help of Assets Library Framework. Available in iOS 4, you can have more access than that provided by UIImagePickerController. For sample code check this out: http://blancer.com/tutorials/i-phone/58725/asset-libraries-and-blocks-in-ios-4/ Its a great tutorial for starting off with.

Bangdel