Category Archives: EffectiveUI

category

SQLite and AIR apps with Cairngorm

Having never done any SQLite stuff prior to the session survey, building it was a definite learning experience.

The hardest part of building with SQLite I think, is working with existing data. Writing data for later retrieval, cake. retrieving "offline" data, that was a bit more labor.

To start, populating the SQLite DB, isn’t fun. I bought an off the shelve tool, SQLite Manager, that I like a whole lot. It supports SQLlite 2 and 3.

I’m not sure, but I’m guessing it’s the nature of SQLite files, that once you’ve created the table and started working with it, making changes to structure, ain’t possible.

I suppose since it’s a flat file of some sort, making structure changes once populated, wouldn’t be possible, but still a pisser. LOL.

Make sure when you create your "offline" tables, you know what you want.

For the survey app, we needed users to be able to still pick a track, and still pick a session from that track.

 

Tom and I ended up making our Cairngorm commands dual prupose. Getting on and off line data. Detecting whether the user is connected as a simple matter of implementing a URLMonitor to ping our site.

The command, looks for our global "am I online" var, and if we’re not online, executes the SQLite functionality.

 

In order to make the commands as loosely coupled (for lack of a better term) to being on or off-line, we made the SQL result handler, call the command’s normal result. From there the result() looks to see what type of result it’s getting, since delegate sends a different type of result Object, than the SQL connection does. From there, it’s a matter of formatting the data and storing it.

Our execute() looks like

if (model.networkConnection)
            {
                var delegate:SurveyDelegate = new SurveyDelegate(this);
           
                delegate.getTracks();
            } else {
                var connection:SQLConnection = new SQLConnection();
                var dbFileString : String = "360Survey.sqlite";
               
                var dbFile = File.applicationDirectory.resolvePath(dbFileString);
               
                connection.open(dbFile);
                var sqlQuery:String = "SELECT trackID, trackTitle, trackShortName FROM tbl_tracks";
                dbStatement.sqlConnection = connection;
                dbStatement.text = sqlQuery;
   
                dbStatement.addEventListener(SQLEvent.RESULT, onRetrieveDataResult);
                dbStatement.addEventListener(SQLErrorEvent.ERROR, onDBError);
   
                dbStatement.execute();
               
               
            }

Then the result() does the "what did I just get" logic.

public function result(data:Object):void
{
    trace(‘[GetTracksCommand] – Result’);
    var resultData:ArrayCollection = new ArrayCollection();
    var tmpAC:ArrayCollection = new ArrayCollection();
        
    if (data.hasOwnProperty("result")) {
        resultData = data.result;
        } else {
            resultData = new ArrayCollection(data.data);
        }

I was a bit worried that it would be harder to build a connection aware application, especially since Tom and I didn’t really start writing code, until about 2 weeks out from Atlanta. There’s still a few things to re-factor in the code, and get cleaned up, but I think when we put this app out into the Open Source domain, other conferences will be able to easily modify it to their needs, they’ll need a CF backend, unless they want to replace the CFCs with .NET, PHP or Java whatever, but hey, it’ll be a starting place.

 

 

 

 

Ready for my next project.

I wrapped up my stint with Ribbit right before leaving for 360|Flex Atlanta, so now that I’, back in town I’m ready to get started on my next adventure.

I’m always open to Flex Dev projects, bring ‘em on. I’m in Denver, but travel ain’t no biggy :) But sorry, I’m not moving.

My ideal position, still is something where I can help a company build and support the community they exist in, be it the overall, worldwide community (flex developers, small biz owners, mac users, whatever)  or a community of their own (ie Ribbit and their API developer community).

I suppose it’s one of those "Dream job" type deals, but hey! You never know. Some company out there is getting ready to launch an API, go public with a tool, etc and they might want some one to help build and nurture the community. Worth a shot :)

360|Flex Session Survey App

I’m looking for some ideas on what everyone would like to see in the Session Survey. Give me your ideas…

So I’m spending some of my down hours while I work on my next gig working on the session Survey App.

Our launch during the conference went ok, a few bugs, nothing too bad. Now it’s time to clean up and enhance. I’m thinking we’ll try to get it to a nice 1.0 place, and then put it up on RIAforge. I wanted to put a few more security measures, and user experience enhancements.

I also wanted to get anyone’s input on what they’d like before it goes, Open Source.

I’m working on validating Attendee ID, so we can minimize crap data. Then I’ll work on setting your ID into a shared Obj for persistence, maybe just us SQL Lite? I dunno.

I’m also going to improve the user feedback, when the app is working in "offline mode" maybe a cool status light or something? Also will make sure the save complete dialog shows up in both modes, not just ‘online’

Besides those three things, what would ya’ll want in a survey app for conferences?

If you’re an attendee, let me know what you think of the app, no holds barred. I know it’s rough, shoot! Tom and I worked on it off and on just the last week or two leading up to the Conference. You know the saying about the mechanic having the crappiest car.

I’m excited to get it buttoned up enough to put up on RIAforge, it’ll be my first OS project… yippy! I’m really hoping others will jump in to help improve conferences of any type.  Part of the release will include the DB design, you’ll need to create your own SQL lite DB for offline mode, with your own data, sorry, can’t give out our attendee info.

Holy crap I’m being followed!

Saw this on TUAW

According to some research from Mindset Media, Mac owners are:

  • to be perfectionists
  • to use notebooks
  • to use teeth whitening products
  • to drive station wagons
  • to pay for downloaded music
  • to go to Starbucks
  • care about "green" products and the environment
  • to own a hybrid car
  • and last but not least … to buy 5 pairs of sneakers in a year

Holy crap! They’ve been following me! I mean, not 100% spot on, I don’t buy 5 pair of sneakers in a year, barely even in 5 years. I don’t own a hybrid, though i do drive a wagon (Audi A4 baybee!!) i do enjoy me a Frapacino from time to time, and i don’t pirate music (any more). I’m down with green, so long as it doesn’t cost horse power, or bring me closer to Boulder.

It’s a funny little bit of "duh, that was obvious" but fun none the less.