cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shravan Narayan (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CB-285) Add property returning root path of PhoneGap files
Date Mon, 06 May 2013 16:06:16 GMT

    [ https://issues.apache.org/jira/browse/CB-285?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13649818#comment-13649818
] 

Shravan Narayan commented on CB-285:
------------------------------------

Went through the data for a few more the platforms' file storage requirements
android: http://developer.android.com/guide/topics/data/data-storage.html
ios: http://developer.apple.com/library/ios/#documentation/FileManagement/Conceptual/FileSystemProgrammingGUide/FileSystemOverview/FileSystemOverview.html
windows phone: http://msdn.microsoft.com/en-us/library/windowsphone/develop/ff402541(v=vs.105).aspx
blackberry: https://developer.blackberry.com/cascades/documentation/device_platform/filesystem/index.html
tizen: https://developer.tizen.org/help/index.jsp?topic=%2Forg.tizen.native.appprogramming%2Fhtml%2Fbasics_tizen_programming%2Fio_overview.htm

No major surprises except, that the sd card on windows phone is read only (also it requires
you to specify which extensions you want, but that may or may not be pertinent here)
Also now I don't think we need a separate api for the app directory

So I would like to suggest that the api be 
cordova.file.getDirectoryForPurpose({
  optional boolean needWritableAccess = false,
  optional boolean sandboxed = true,
  optional LocalFileSystem.Category category = LocalFileSystem.Category.DATA,
  optional LocalFileSystem.Persistance persistance = LocalFileSystem.Persistance.PERSISTANT
- up for debate
}, function callback(location){
   if(location)
        // Success
});


LocalFileSystem.Category
{
  // AT LEAST NEED
  DATA, DOCUMENTS,
  // LATER ALSO NEED
  IMAGES, DOCS, VIDEO, AUDIO etc. etc. (need a better summary of platform specific categorizations
of files)  
}
LocalFileSystem.Persistance
{
  TEMPORARY, CACHE, PERSISTANT, DEVICE_PERSISTANT, CLOUD
}

Note: DEVICE_PERSISTANT vs CLOUD
DEVICE_PERSISTANT - store files with syncing such as iCloud on ios enabled, however this is
device specific
CLOUD - store files with syncing such as dropbox on blackberry enabled, however this is may
be the same across devices

Blackberry can implement the DEVICE_PERSISTANT option by storing data in a folder such as
"/Cordova_Device_Data/MY_DEVICE_NAME/" to maintain a saparation across devices.
                
> Add property returning root path of PhoneGap files
> --------------------------------------------------
>
>                 Key: CB-285
>                 URL: https://issues.apache.org/jira/browse/CB-285
>             Project: Apache Cordova
>          Issue Type: Improvement
>          Components: CordovaJS
>    Affects Versions: 1.4.0
>         Environment: Both PhoneGap SDK and PhoneGap Build
>            Reporter: Ashley Gullen
>            Assignee: Andrew Grieve
>              Labels: features
>
> There needs to be a property in PhoneGap that returns the root path to the general files
added to the PhoneGap project (i.e. the directory index.html is in).  For example, if I add
'music.mp3' to my project, in Android it will be located in:
> /android_asset/www/music.mp3
> On iOS after being built with PhoneGap Build it will be located in some path like this:
> /var/mobile/Applications/<app_ID>/<name>.app/www/music.mp3
> However, there does not appear to be a programmatic way to determine both <app_ID>
and <name>.app.
> This has two side effects:
> 1. Paths to audio for Media must be hard-coded separately depending on the platform,
which is inconvenient.
> 2. Paths to audio for Media cannot be known if developing a framework that uses PhoneGap.
 Since a framework does not know the App ID or name in advance, it's impossible for the framework
to determine the correct path.
> This is actively blocking audio from working on iOS in PhoneGap projects exported by
Construct 2 (www.scirra.com), a HTML5 game creator.  Also, it seems like kind of an important
function to make available anyway, since hard-coding paths for each platform is a pain.
> This PhoneGap Support thread led to this issue: http://phonegap.tenderapp.com/discussions/questions/208-android_asset-equivalent-for-ios

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message