This document has as objective to specify the architecture and the design considerations of the aFileDialog library, in order to serve as a reference for the developer's team involved in the maintenance and development of the library.
This specification has been developed under the standard IEEE 1016-2009, also known as the "Standard for Information Technology - Systems Design - Software Design Descriptions", an IEEE standard that specifies an organizational structure for a system design description.
- GUI - Graphical User Interface
- IEEE - Institute of Electrical and Electronic Engineers
- MPL - Mozilla Public License
- SDD - Software Design Description
IEEE Computer Society. "IEEE Standard for Information Technology - System Design - Software Design Descriptions". 2009
The remainder of this document outlines the system's architecture, describes the relationship of the various modules, and goes over the design decisions.
It is assumed that the reader have basic knowledge about object-oriented programming in Java and about application's development on Android.
aFileDialog is a library that implements a file chooser for the Android operating system, which lacks of a native graphic component for provide this functionality. The library was designed to be easy to use and easy to develop, it is licensed as open source, under MPL v2.0, in order to encourage his use and development.
His main features are:
- The file chooser can be opened as a Dialog and as an Activity.
- It has two selection modes, one for select files and another one for select folders.
- It allows to create files or folders.
- It can filter the files that can be selected by using regular expressions.
- It has multi-language support (by default, it only provides translations for English, Spanish and French, but the developers can re-define the value of the labels and texts, in order to add more languages or modify the current ones).
- It is entirely implemented in Java and it is compatible with Android 2.2 or superior.
None.
The library must be entirely implemented in Java and it must be compatible with Android 2.3 (at least) and later versions.
The objective was to develop a library which provides a file chooser, for the Android operating system, easy to use and easy to modify, according to the KISS principle (Keep it short and simple).
The development method used was incremental and iterative development, according to which the software is developed in several cycles, in each of which new features are added and the features added in the previous cycle are checked and corrected.
The software was structured using the design patterns embedded in the Android API.
The library is composed mainly by six Java files (FileChooser, FileChooserCore, FileChooserDialog, FileChooserActivity, FileChooserLabels and FileItem) and by two XML layout files (daidalos_file_chooser and daidalos_file_item).
- The library's core is defined by the class FileChooserCore, which implements the main features, y by the layout file_chooder, which defines the user interface of the file chooser.
- The classes FileChooserDialog and FileChooserActivity are charged, mainly, of embed the features provided by FileChooserCore in, respectively, a Dialog and in an Activity. Both classes implement the FileChooser interface, which defines all the methods that the class FileChooserCore requires in order to respond to user interface's events.
- The class FileChooserLabels allows to re-define the values of the labels and the texts that are show in the file chooser, in order to allow change the default values or add new languages (besides English, Spanish and French).
- The class FileItem and the layout daidalos_file_item define a graphic component that represents the files and folders that are listed in the file chooser.
All the functionalities of the file chooser are implemented in the class FileChooserCore, whom in his constructor requires an instance of the interface FileChooser. FileChooser defines the methods which a subclass of View, that uses the layout daidalos_file_chooser, must implement in order to be used as a file chooser.
In this way, we can 'simulate' multiple inheritance (which is not supported by Java): the classes FileChooserDialog y FileChooserActivity inherit, respectively, from the classes Dialog and Activity, and in his constructors they create an instance of FileChooserCore in order to 'inherit' also all the features implemented by this class.
The graphical user interface is defined by the XML files daidalos_file_chooser and daidalos_file_item.
daidalos_file_chooser defines the interface of the file chooser, which is composed by a vertical layout, which occupies all the width and height of the screen and in which the files and folder (that can be selected) are listed, and by two buttons located in the bottom, one for create files or folders and another one for select the current folder (in the case that the file chooser is being used for select folders instead of files).
daidalos_file_item defines the interface of the graphical component used for represent the files and folders that are listed in the vertical layout of the file chooser. This component is composed by a icon, which allows to differentiate files from folders, and a label, which shows the file's name.
daidalos_file_chooser is used by the classes FileChooserDialog and FileChooserActivity, which acts as intermediates between the layout and the class FileChooserCore, while daidalos_file_item is used by the class FileItem, which is a subclass of LineaLayout that defines the graphic component used for represent files and folder.
All the labels and messages show by the different classes and graphical interfaces are defined in files string.xml, making use of the internationalization mechanisms provided by the Android SDK.
By default, only the languages English, French and Spanish are supported, however the developers can add new languages (or modify the current ones) by using the class FileChooserLabels.
In each instance of the class FileChooserLabels we can re-define the values of the labels and messages. This instance then must be passed to the class FileChooserCore, in order to use the values defined in this instance, instead of using the values defined in string.xml.