Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The tablet screen is partitioned into multiple fragments. Some fragments provides inputs. For example, the MainTabFragment reports which function tab that user has selected: consumption devices, reserved power, or pricing information, and TimeframeTagFragment reports which timeframe that user has selected: daily, monthly, or yearly. SmartGridActivity class serves as the controller of the application. It receives inputs from the input fragments, and drives the outputs. One output is the Chart. Another output is the Operation Area. SmartGridActivity class loads DeviceTree, SortedDeviceList, DeviceSettingsPage, TransactionTable,  and TransactionFragment into the Operation Area dynamically based on user inputs. Device, DeviceManager, and PriceManager serves as the abstraction of the back-end, providing data to the application.

Using the Fragment paradigm is the most important implementation decision. Android prior to 3.0 uses Activities to manage TabHosts. For GR4, we used this paradigm, which resulted in nested TabHosts of three levels deep. This exposed a few bugs of Android itself, and they were difficult to fix. It also made it difficult to make timeframe and device selections consistent over different tabs. Using Fragments solved these problems.

Evaluation

Reflection