Thursday, April 12, 2012

What I've been working on...

So, this was initially supposed to be a blog about tech news and things I have been working on, but that kind of turned into my weekly blog for a class of mine.  That, and I got so caught up in school work that I have been unable to create sophisticated posts.  I'm terribly sorry!  I am going to try and write more often because it's fun and it might be helpful for others.  Promise.

Anyway, while my busy semester has given me almost no room to breath in my normal life, I've actually spent some time for myself on developing applications for iOS (prominently iPhone).  I haven't made much, but I've been working on two applications that I think some people would use in the (hopefully) near future.  Of these two apps, one of them has been a big project for me, and that's the Texas Drums app.

Creating an application isn't as easy as it sounds, and without the proper tools, it can be an arduous and very cumbersome task.  I've been having to work both on the front-end of the application (UI, data fetching/parsing, synchronization) as well as the back-end (database integrity, API construction).  It's taken many hours to construct a resilient API that will send proper data (formatted in either JSON or XML) based on the URL parameters, and then to parse this data in a way that the iPhone API can understand.  I've gotten most of it constructed, but much of it needs to be tested.  That's one thing I've been trying to improve whenever I code: unit and acceptance testing. These ideas are so integral to programming. It's a good sanity check on whether your functions or methods return valid results for any kind of query, or if they throw exceptions out the wazoo.

Anyway, I feel like it would be cool to show some pictures of what I've been developing so that people can get a taste of what to expect when the application gets published into the App Store. Without further ado...

Click to enlarge. It's eye candy. :3
 Here's a shot of the News screen. As you can notice, the organization is fairly similar to that of our website.  Items highlighted in orange are member-only posts, a feature that will be utilized more when the app comes out. When you click on a news post, you'll be directed to the full post.  Fairly simple.

In order to obtain this information, a call to the database must occur.  Since iOS doesn't have any built-in connection library to SQL, I had to create an API so that a URL call will command a SQL query.  Essentially, I created a PHP file that, when called with certain GET arguments, will formulate a SQL query, send the query to the database, and return the data.  This data is converted into an array of arrays, and is then converted into a  serialized JSON string.  This is an interchangeable piece of data that can be converted back and forth in order to manipulate data properly.  The PHP file returns this string, and the iOS library retrieves the response.  With the help of a JSON library for iOS, I take the result and de-serialize it, which turns it into an NSDictionary of NSDictionaries.  Then, it's just a matter of iterating through the dictionaries, storing the data into an appropriate container (NSArray or NSMutableArray), sorting appropriately (i.e. using the timestamp within each post), and then sending the proper data to the UITableView (title of the post, summary of the post).  This concept is enumerated several times throughout the app, actually.  It's all about calling the API, generating a result, parsing the result, saving the result, and sending the result on screen.  This concept is also illustrated below, in the Roster page.




Similar to how we grabbed data for the News page, we do it here with the Roster page. Like our website, you can choose which year to browse.  Upon clicking a year, you'll be directed to a list of members who were on the drumline within that year.  You can then click on their name and view their nickname, quote, classification at the time (freshman, sophomore, etc.), and much more!  If you are a member of Texas Drums, you'll also have access to their contact information.



One more shot.  This is a brief display of our information page (similar to our About page).  You can click on the items within the table to view information about us, common questions, our section leaders, and so on.  I want to eventually incorporate a way for prospective members to be able to contact section leaders via email directly within the app.  I feel like that would be a very convenient thing to incorporate.  I get emails frequently about who to contact for camp information.  Even though the emails are listed on the website, I feel like these aren't as obvious to find.  Within the app, they will be easy to spot: by clicking on a section leader's bio, one will be able to email them directly.

Well, this is it for now; I can't spoil everything unfortunately.  The media page isn't up and running right now, and I don't know if that will ship within the first version of this app.  There's a lot of database maintenance that needs to be done with that section (prominently pictures; they are scattered everywhere).  But I'll constantly be updating my blog for new improvements and updates, as well as how I've done the things I have done within this app.

Thanks for reading, and until next time,

Corey

No comments:

Post a Comment