Wiki

Clone wiki

javarosa / FileManagement

File Management

This page discusses file management in JavaRosa. ALL file interfaces rely on the !FileConnection API's. If these APIs are not supported on your device, none of these activities and classes will work.

File Browsing

File browsing has been implemented as an Activity in !JavaRosa - the !FileBrowseActivity. The UI for file browsing is a simple text-based browser based off of existing file browsing code. The following shows a screenshot of the file browser:

Image(FileBrowse.png)

The FileBrowse activity currently supports two modes: !FileBrowseActivity.MODE_FILE, and !FileBrowseActivity.MODE_DIRECTORY. The difference is whether a file or directory is to be returned. If the mode is set to directory files will not show up, and there is an additional menu item allowing the highlighted directory to be returned. The setMode() method can be used to set the mode, with the default being MODE_FILE.

File System Access

NOTE: This is a temporary solution until File Access becomes a fully blown JavaRosa service and moves into it's own namespace. There is already an [http://code.javarosa.org/ticket/105 existing ticket] for this work.

Files are accessed via the !FileUtility class. Please see the [http://docs.javarosa.org/javadoc/org/javarosa/media/image/utilities/FileUtility.html JavaDoc] for a full list of the current available APIs.

Updated