Skip to main content
August 16, 2011
Answered

Best approach to select multiple/all photos from the iOS CameraRoll?

  • August 16, 2011
  • 3 replies
  • 20548 views

I want to use FlashBuilder 4.5.1 to build a flex mobile photo organizer project that lets me select multiple photos from the iPhone Camera Roll.

I've seen the flash.media.CameraRoll class, but it only seems to provide CameraRoll.browseForImage() that opens a dialog to pick ONE photo.

Has anyone built an app that lets users select multiple photos or select all from the CameraRoll? Can you access the embedded thumbnail DB or do you have to import all the photos into the ApplicationStorageDirectory first? Am I better off writing a native iOS application?

Does flex mobile allow something like this:

// is this a security violation?
var cameraRoll:File = new File('/var/mobile/Media/DCIM');

var photos:Array = [];
var folders:Array = cameraRoll.getDirectoryListing();
for (var i:int=0 ; i<folders.length; i++) {
    var files:Array = folders.getDirectoryListing();
    for (var j:int=0 ; j<files.length; j++) {
        var photo:File = files;
        photos.push(photo);
    }
}
// show photos, somehow...

However, this method does not provide access to thumbnails managed by: '/var/mobile/User/Media/Photos/Photo Database'

from: http://stackoverflow.com/questions/6936881/how-do-you-access-the-ios-camera-roll-from-a-flex-mobile-project

This topic has been closed for replies.
Correct answer Joe ... Ward

Right now (AIR 2.7), the CameraRoll class doesn't have the features you need. In AIR 3 (release data TBA), you could write a native extension that would provide such features. So, if you need these features right now, or you don't think the benefits of using AIR for the rest of your application are sufficient, then you should write a native application. On the other hand, if the rest of the application is faster and easier to write in Flex than Objective C or you want to publish the app on Android and Playbook (and maybe the desktop as well), and you can wait a bit for AIR 3, then you will probably come out ahead sticking with Flex.

3 replies

November 20, 2011

I also really need this.

Native extensions are now possible, but I don't have a Mac, so I can't actually create the extension.

Has anyone actually created a native extension for iOS to access all of the user's images (including thumbnails)?

This has been holding a project of mine up for a month and a half.

Thanks!

November 22, 2011

I paid someone to write a Native iOS app that works ok, but it's hard for me to extend. The "select multiple/all" photos component works fine, but loading the photos into the app sandbox is VERY SLOW, and not properly threaded.

I would like to move my dev to FlexMobile and am willing to contribute my current code if someone wants to take a hack at it. Please feel free to fork https://github.com/mixersoft/odesk-11563930

I'd help, but I only know scripting languages.

m.

Participant
October 24, 2012

Hi mixersoft,

I am developing a mobile app for iPad (using Flex Builder) and need  select multiple photos from the cameraroll.

Please, can you help with this?

I don't know how to write a native extension on iOS.

Thanks!

Known Participant
November 1, 2011

Did you come up with a solution? I have to upload multiple photos in my app.

November 2, 2011

Not a good one yet. I hired a programmer to write a nativeiOS app, which turned out ok, but not great. The problem is that it took a lot longer than planned and I have to pay to do simple changes. Also, the programmer had me make many UI compromises to keep the native iOS app from using too much memory when dealing with many full-res photos. Not sure if a Flex Mobile project will have the same issues.

Now I'm trying to figure out if I can resue some of that code to build a Flex Native Extension. Haven't gotten to it yet. Wanna help?

Joe ... WardCorrect answer
Participating Frequently
August 16, 2011

Right now (AIR 2.7), the CameraRoll class doesn't have the features you need. In AIR 3 (release data TBA), you could write a native extension that would provide such features. So, if you need these features right now, or you don't think the benefits of using AIR for the rest of your application are sufficient, then you should write a native application. On the other hand, if the rest of the application is faster and easier to write in Flex than Objective C or you want to publish the app on Android and Playbook (and maybe the desktop as well), and you can wait a bit for AIR 3, then you will probably come out ahead sticking with Flex.

Participant
September 4, 2011

I already install the AIR 3.0 but i can't see the multiple images camera roll selection features? Do you any example?

HUGO

Participating Frequently
September 6, 2011

You would need to write a native extension that supports multiple image selection. While the native extension feature is in the beta, we haven't released the documentation required to use it. This documentation will be available when AIR 3 is released.