Not able to browse directories/files in ipad4/iOS 6

4 posts, 0 answers
  1. P
    P avatar
    2 posts
    Member since:
    Feb 2013

    Posted 02 Mar 2013 Link to this post

    Hi,

    I am using Graphite on PC and ION on Ipad 4. Trying to browse all photos in the device. Used cordova api for working with files:

         window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, gotFS, onFail);
        
         function gotFS(fileSystem) {
                var dir = new DirectoryEntry("Media", "/var/mobile/Media/DCIM");
                var dirReader = dir.createReader();
                dirReader.readEntries(onReadEntries,onError);
        }

        function onReadEntries(entries) {       
            var i;
            for (i = 0; i < entries.length; i++)
            {          
                if (entries[i].isFile == true)
                {        
                    // ...          
                }    
               
                if (entries[i].isDirectory == true)
                {                                 
                    alert(entries[i].fullPath);                  
                    var directoryReader = entries[i].fullPath.createReader();                
                    directoryReader.readEntries(onReadEntries, fail);          
                }       
            }   
        }

    There is an error on createReader() method. It works only for specific folders like /var/mobile/Applications but not for Library, Media etc
    I am not sure that this problem is related with icenium or cordova script. Read that there is a new version for cordova 2.5 so when you will be able to provide plugin for it.
     
    Kind Regards,
    Plamen
  2. Evgeni "Zammy" Petrov
    Admin
    Evgeni "Zammy" Petrov avatar
    168 posts

    Posted 07 Mar 2013 Link to this post

    Hello,

    There is no pure way to interact with the asset library using Cordova right now. You can use the Camera API and ask the user to pick a photo from his photo library. If you need to enumerate all files in the library you can go native and use Objective-C and ALAssetsLibrary. Currently Icenium does not support any way of modifying underlying native code.

    I guess this must be implemented through an iOS specific plugin.

    Greetings,
    Evgeni "Zammy" Petrov
    the Telerik team

    Share feedback and vote for features on our Feedback Portal.
    Want some Kendo UI online training - head over to Pluralsight.
  3. P
    P avatar
    2 posts
    Member since:
    Feb 2013

    Posted 07 Mar 2013 Link to this post

    Thanks for the quick answer.

    Actually I want to view only all camera photos (something like photo gallery, not one by one selection and not other file types). I am using code from Cordova api:
    http://docs.phonegap.com/en/2.5.0/cordova_file_file.md.html#File
    So I saw that Camera part is working correct but it seems that there is a problem with File part of the Cordova api.
    So think it has to be possible. I am able to do that with eclipse and phonegap plugin with simulator.
    And what is the current version of Cordova which is plugged in Icenium

    Best Regards,
    Plamen
  4. Evgeni "Zammy" Petrov
    Admin
    Evgeni "Zammy" Petrov avatar
    168 posts

    Posted 09 Mar 2013 Link to this post

    Hello,

    Currently it is Cordova 2.2.0. Next release Cordova 2.4.0 will be an option.

    I am confused what you are trying to achieve.
    The sample you are talking about tries to send an image to a server. 
    Can you explain in detail what you are trying to achieve?

    Kind regards,
    Evgeni "Zammy" Petrov
    the Telerik team

    Share feedback and vote for features on our Feedback Portal.
    Want some Kendo UI online training - head over to Pluralsight.
Back to Top