Skip to content
Jonathan Daniel edited this page Oct 26, 2017 · 3 revisions

App Structure

The overall structure of this app is very simple and consists of the following: 4 classes and 1 external library. The purpose of each class and the external library is explained below.

FileSelector.java

The only purpose of the file selector activity is to provide an interface for the user to select and add new files. Once the user picks a file, the file is read and set as the current file for the app before launching the Tracker activity.

Tracker.java

The purpose of the Tracker activity is to serve as the UI for the user to interact with when editing commodities. This activity will mainly be started from the FileSelector activity after a file has been picked.

FileManager.java

The File Manager class is the backbone of all file operations in this app. Every single interaction with the file, whether it be reading and writing the file, or changing the commodities, is managed through here. To minimize the amount of I/O occuring, the file is read once and its commodities are saved in an arraylist. When the tracker activity is interrupted, then the file is written with the updated changes.

Commodity.java

This class is used to represent different commodities that the user may create in the app. The design of this class is meant to fulfill the standards of a Java BEAN object so that the app is compatible with the Super CSV library.

Super CSV

Clone this wiki locally