views:

55

answers:

1

I'm building my first AIR application after two years of building Flex applications with a SQL Server database, using ColdFusion CFCs and .NET as WebService interfaces.

I want to create an AIR application with static data and I'm trying to figure out the best way of doing this, and how to do this. I have several related pieces of data.

Should I store all the data in XML files and read it directly from there? Or should I use the built-in SQLite database? If I use the SQLite Database, is there anyway to have the data pre-populated with the application, or does it have to be built each time the application is loaded? If using the SQLite database, can someone point me to some help on how to do this?

I apologize if these questions are too basic, I'm just looking for ideas as I try to build my first AIR application.

+2  A: 

I agree with MysticEarth. And depending on what kind of data you have, how often it will change, how comfortable you are with xml parsing/generation vs. sql queries, you'll want to use whichever approach best suites your needs. For all I know it might be a combination of the two...

And for what it's worth, in my experience sqlite has some shortcomings and the e4x xml extension is pretty sweet (and fast)!

Good luck!

Edit:

Yes you can "embed" the xml in your app. It's not the most flexible implementation, but if that's what you want you can have it :)

It's as easy as:

var xml:XML = 
        <foo>
            <bar>text1</bar>
            <bar>text2</bar>
        </foo>;

Check out the following link: http://help.adobe.com/en_US/AS3LCR/Flash_10.0/

heavilyinvolved
I agree e4x is pretty sweet once you get the hang of it.
invertedSpear
THe data will not change. If it changes, it will be by means of an update to the application. Can I "embed" an XML file into the application, so that it can be read but not edited?
Eric Belair