Pages

    Monday, February 21, 2011

    Final Admission of the Rock Star

    Well, what a wacky and wild week so far.  And it's only Monday (it is Monday, right?).

    Long story short, Cole started running mild fevers on Thursday night.  We took him in Friday, but the fevers cleared up.  Per protocol, they drew cultures.  Saturday morning at 6:30 AM we got the call that the cultures grew bacteria.  And not only did they grow, they grew with zest!  Back to the hospital (this time through the ER) where they drew more cultures (the second set) and admitted us up to good ol' 8B.

    Keep in mind that Cole has been completely asymptomatic this whole time.  He's the picture of 5 year old health.  With that mentality, we waltzed up to 8B.

    It was a bit like walking into Cheers, and Cole was Norm.  Nurses and clins would look at Cole (without recognizing him), look at me, remember me, then realize who this big boy was that was standing next to me must be.  Their jaws would drop open, they'd do a double take back to Cole, then yell "COLE!!!!!!!!!!!!!!!"

    At one point, I had to leave the room for about 15 minutes.  I came back to find Cole, sitting on the bed with two nurses, telling them all about his plans to be a marine biologist and study at UNCW.  He's been like a rock star.  The floor staff all remember him, and they all love him.  It does a daddy's heart good to know there's a special place where his little boy is loved so dearly.

    Here's the medical low-down.  Cole's line has most likely been "colonized" by a common skin bacteria (Staph epi, for those that keep track of these things).  Colonized means that the bacteria has likely been living there for some time, but it's not causing Cole any trouble.  It's also likely the cause of the positive culture that grew back in January.  It's not really dangerous, but it's still a potential source for infection and the best way to treat it is to take his line out.

    Now, quite miraculously in my mind, this line has lasted us for two years of being accessed once to twice a week.  That's hard use for a port-a-cath line, and by all rights we should have had an infection well before now.  But, the line lasted almost exactly as long as it needed to.  I'll let you attribute that to what you will, but I know where I'll attribute that kind of providence.

    So, tomorrow, Cole's line will get pulled.  He'll have two more days of IV antibiotics (through a regular old IV) and then, sometime Thursday, we get to go home.

    And when we go home, Cole will be well and truly finished with his cancer treatment.

    Wednesday, February 16, 2011

    Learning Android: Appcelerator's Titanium vs. Native-built Apps

    I have finally been able to take the time to do something I've been wanting to do for a long time:  some mobile development.  I decided to work on some Android apps first, as the barrier to entry is a little lower.  As this was an exploratory mission, I thought I would give a few development options a try.  Those development options were native Android development via Eclipse and Appcelerator's Titanium Platform.

    By way of explanation, Appcelerator's Titanium Platform is a development environment that allows you to write HTML/CSS/JavaScript apps and have them compiled down to native code (Android or iOS).  Titanium provides a rich framework of APIs from which to build your apps.  For instance, the UI components in Titanium are analogous to the UI components in Android.  The advantage to Titanium is that you can take one app and compile it down to any of the supported platforms, like Android or iOS.  Since Titanium compiles down to native code, you're not running interpreted, though there are some specific wrappings that Titanium has to build in.

    The app:  Quotious

    For my app, I had a few necessities.  First, it had to be twitter-like, meaning that it was a bunch of short messages that can be displayed as a list.  I also wanted the data to be served up from some external source and arrive packaged in JSON.

    Based partly on these needs, and partly on an idea I got from a buddy, I decided to build an app that captured quotes.  You could specify the author of the quote, the source of the quote and the quote itself.  Nothing too fancy.  I called it "Quotious".

    In light of that, I first built out a small Jetty based server which I could run on my local.  It was backed by a MongoDB database.  The server simply served up the contents of the database in a RESTful manner (I really only implemented the GET).  I seeded the database with a bunch of quotes from Darth Vader, as he is a worthy source of quotes all over the interwebs.

    Then, I got to work building the apps.

    Titanium Quotious

    Titanium Quotious
    I decided to delve into Titanium first, as I was most excited about that.  While I can do all the Java programming anyone could ask for, I absolutely love working with JavaScript.  Titanium seemed like it would be a fun experience.

    From start to finish, it took me about two days to turn out the Quotious app in Titanium.  Titanium offers a great example app called "Kitchen Sink" that implements examples of an incredible number of their APIs.  I relied heavily on an example twitter app that comes included with Kitchen Sink, adapting it for my needs.

    The Titanium implementation of Quotious doesn't have a persistent store and pulls the data over a RESTful call every time you fire up the app.  In that manner, it's not very robust, but the real story here is that it was almost trivial to implement.  I was able to bring all of my traditional web app skills to bear and had I really been trying I could have turned it out faster.

    Native Quotious

    After I was done with the Titanium version of the app, I turned my hand to a natively built implementation done in Eclipse.  I quickly went through all the tutorials and found myself in an interesting position:  After Hello World, there wasn't a clear path to building up my understanding.  So, I turned to The Goog and found this superb implementation of a twitter app that is put together as a tutorial by Marakana.

    Native Quotious
    This app took me about twice as long to build, roughly 4 or 5 days.  The reason, though, is significant.  Titanium abstracts away much of the underlying Android structure.  You are free to basically build your app as if it were a web app and not worry about the inner workings of Android.  While those inner workings can only suffice to make your app stronger, they're not strictly necessary to simply build an app with Titanium.

    As I worked through the Marakana example, I was enlightened about all of the various moving parts that truly make up an Android app.  From the Manifest.xml to the views, from the actions to the intents, I had to actually learn what went into an Android app.  This accounted for much of the increased time of development.

    The native app that I developed is slightly more robust than the Titanium version.  It is backed by a SQLite database.  As updates are fed from the web source they are placed into the database.  As those changes go in, the UI is updated and what you see on the left is what is created.  In light of the database, my app will survive a loss of connectivity with grace, serving up what it has already seen and remembered in the past.

    Conclusion

    Let me not give the impression that Titanium is only about building web-app like Android apps.  It's not.  There is rich support for what makes a truly native app within Titanium.  You can create and manipulate a database, you can work with actions and intents.  You can do all of these things.  (Update:  See the first link below for some info on how to do all of these things)

    But you don't have to.  And therein lies what might be the most seductive thing about Titanium.  You can build your app as if it is a web app, only it runs natively.  You don't have to expand your skill set to understand all of the ins-and-outs of what makes up an Android app.  All you have to do is take your current skill set for building JavaScript heavy web apps and port them over to your device of choice.

    If developer time is your main constraint, then Titanium is likely the way to go.  You can hit the ground running faster with Titanium.  You don't really have to be an "app developer" to develop apps with Titanium.  What's more, and something I only lightly touched on, with very little augmentation, you can port your app to an entirely different platform such as iOS.  With very little, if any, changes, I can run the Titanium version of Quotious on an iOS device by simply compiling it down.

    One word of caution, though:  If you choose the Titanium route, don't eschew learning what really goes into an Android app.  Knowing the actuals behind Android can only make you a stronger developer in the long run.

    Edited:  For formatting
    Updated:  Added pointer to first comment with additional information