This is a migrated thread and some comments may be shown as answers.

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

3 Answers 59 Views
Apache Cordova
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
P
Top achievements
Rank 1
P asked on 02 Mar 2013, 10:05 PM
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

3 Answers, 1 is accepted

Sort by
0
Evgeni "Zammy" Petrov
Telerik team
answered on 07 Mar 2013, 01:08 PM
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.
0
P
Top achievements
Rank 1
answered on 07 Mar 2013, 09:19 PM
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
0
Evgeni "Zammy" Petrov
Telerik team
answered on 09 Mar 2013, 08:44 PM
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.
Tags
Apache Cordova
Asked by
P
Top achievements
Rank 1
Answers by
Evgeni "Zammy" Petrov
Telerik team
P
Top achievements
Rank 1
Share this question
or