Tuesday, May 10, 2011

SystemH - iPhone Application

For my final project in Software Engineering class, I've opted to develop an iPhone app for the Team Hawaii Solar Decathlon project.

The app will provide an interface to the Home Management System, which we developed as a semester-long project in our software engineering class. This blog post will document the weeklong project process.

I've had a little iOS experience during my internship with Ikayzo, Inc., but for the most part, I'll be learning as I go.

Day 1 (Monday, May 9):
The iPhone must communicate via XML with the backend to the Home Management System (HMS). So I looked up a few XML parsers for iOS and found the following useful articles:
Seems like for now, we'll try gdataxml for the simple reason that the iPhone needs to be able to both read and write xml data to the backend system.

The app will request data from the HMS via a GET request, and send commands to the HMS via a HTTP PUT command.

Downloaded the entire HMS project from the Google Project Hosting site, and examined the backend system and house simulator to get a better understanding of how the systems work in their current final state.

Time spent: 2 hrs

Day 2 (Tuesday May 10):
Started reading the following book and started doing some iOS tutorials. I plan to take about 3-6 hours doing tutorials to familiarize myself with how to setup different screens and support navigation through an app.
There are a few things that I need to be able to do in order to complete the project:
  • connect to a URI
  • parse and write XML
  • get XML data and put XML data to a given URI
  • have multiple screens/views
  • navigate easily and naturally between the views
  • be able to include images and other items in the app
  • allow the user to enter in an ip address or base URI
  • store user settings
Tutorial 1: Button interactivity. Did a short tutorial on how to make buttons interact with text on the screen. This should be useful since there will be buttons on the app that should display a response message when pressed.


Tutorial 2: More interactivity. This tutorial goes over the following controls: segmented controls, switches, and sliders. It also dealt with modal windows (alerts and action sheets).


Total Time: 4 hrs

I think at this point the main thing I need to worry about is navigation within the app. That and XML parsing.

TOTAL TIME SPENT ON PROJECT SO FAR: ~22 hrs

Day 5 (Friday May 10):
Blogger went under for maintenance yesterday and somehow purged about two days worth of writing. Oh well, no harm done :)

So this is where I stand now:
  • Can parse XML from the backend system
  • Have implemented a navigational bar as well as a tab bar
  • Finished Energy calculation
  • Have tested an HTTP PUT request to change the Aquaponics temperature successfully
  • Have implemented AJAX-type updating to live update every N seconds
The image below is a good indicator for how far I've gotten:


Still to do:
  • I'm still having a great deal of trouble putting sliders inside of cells within UITableView. This, however, can probably wait until version 2.0. Tables are nice and great to look at but I need to really read up on custom cell subclassing first.
  • Might be good to implement some sort of timestamp to read what time the last update was.
  • User settings (host URL or IP), time interval to update
  • Slider controls to send a command to the HMS.
  • Error catching for when a connection is lost or when there's a parsing error.
I've about 4 hours left. I think it'd be reasonable to expect the timestamp implementation as well as the slider controls for at least the HVAC system. I have a feeling lighting will be neglected.

Time spent: 4 hours

Just made a wiki page for the app on Google Projects.

I'm also gonna take a quick stab at showing a timestamp at the bottom of each screen to show the last updated time.

Done for today. This week. 7:39pm. 2 more hours in the bag.

-------------------------------
Total Time Spent: 28 hrs