Friday, January 1, 2010

My first iPhone Webapp

At work, I am a serious scripter.  I try to use VBscripts for almost every repetitive task I do for the simple reason that I make mistakes, computers don't.  If I have to edit the properties for 200+ Citrix-published applications (a task I've had to do numerous times), the chances of my breaking things is much greater than if I just get it scripted and tested once and let the script do the heavy lifting. 


But, VBscripts just haven't been cutting the mustard for some of the more onerous tasks in recent months, and so I took advantage of the fact that Microsoft offers Express editions of Visual Studio 2008 as free downloads.   (Recently, my company got everyone in my group MSDN subscriptions, so I was able to get VS2008 Pro to use!)  I had been wanting to get more familiar with Visual Studio and app development in general as I had a couple of things I wanted to try doing.  Figuring the best way to learn was to find a project I wanted to do and dive it, I thought about it for a while until I came up with...


For years my home has been controlled via a home automation system called HomeSeer.  HomeSeer's a great product, put out by a company that stands firmly behind their products, with a great user community that's always ready to help.  One of the pieces of HomeSeer I've played around with over the years is its scriptability.  It has its own .Net-based webserver built in and will run fairly standard ASPX pages as well as VBscripts.  By just adding some references into your project, you can also control it via other languages as well.


And then, of course, there's my ubiquitous iPhone.  Last year I decided to give iPhone development a try and so got a cheap Mac, downloaded the SDK and gave it a shot...and realized after looking at the docs for about 10 minutes that Objective-C is not an easy transition for a VB guy to make.  So, I put it on the sidelines for a while.  Recently, though, I came across iUI.  This is a framework put together by the founder of Facebook that allows developers to very easily create iPhone-based Webapps.  Since it's agnostic to the underlying development framework, I had found my project: I would create my own iPhone interface to HomeSeer.


I see that others have done this, but I had some specific needs I wanted to accommodate.  And, I wanted to learn.  Creating this from scratch would give me a lot of experience with so many different areas, it was too good to pass up.  And, so, I give you....


 



 


Looks pretty cool, right?  It doesn't actually do anything yet, but it's got a lot of stuff going on behind it.  First, it connects to HomeSeer and enumerates all of the devices and gets their status.  Then, it generates this nifty page with a button that's named the opposite of the device's status.  Eventually, the plan is that you'll be able to tap one of those buttons and turn lights off and on.  But, since HomeSeer is very extensible and can be used to control almost anything, so too will this app be able to do a whole lot more. 


Not too bad for an hour's worth of fiddling.  In coming installments, I'll document what I did to get everything setup and in place to make the magic happen because a lot was either poorly documented or the documentation was spread over multiple locations. 


 


 

No comments:

Post a Comment