Search code examples
androidiosimageair

Access saved pictures without CameraRoll on iOS / Android in AIR


Does anyone can confirm that because of sandboxing restrictions, there is no way (eg using File class) to access saved pictures folder (aka DCIM...) without using CameraRoll class and thus native UI on iOS and Android devices?

The reason I want to do this is that I need to create an image browser with larger picture size that the tiny one provided by native CameraRoll UI, like in Instagram app on iOS does.

Maybe an ANE?


Solution

  • On Android images taken by the camera are stored in the public directory, so as long as you have the <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> permission in your -app.xml manifest file you should be able to use the flash.filesystem.File class to access them.

    EG:

    var photoRoot:File = File.userDirectory.resolvePath("DCIM");
    for each (var image:File in photoRoot.getDirectoryListing())
    {
         if (image.extension == "jpg") {//do something}
    )