MAKING AIR APPLICATION WORK OFFLINE

1 view
Skip to first unread message

vrathore

unread,
May 15, 2008, 2:14:56 AM5/15/08
to Delhi Flex User Group
We can make the AIR application work offline and synch with the
database.

We can use sqllite databse for the offline display of data.
sqllite is just like mysql but it would create a *.db file in ur
application folder
from where we can access the data.

A sample code for creating and executing the sqllite queries.

on creation complete we create a database contacts.

private function creationComplete():void
{
connection = new SQLConnection();

connection.open(File.applicationDirectory.resolvePath('contacts.db'));


var statement = new SQLStatement();
statement.text="CREATE TABLE IF NOT EXISTS contacts (ID INTEGER
PRIMARY KEY AUTOINCREMENT, action TEXT, inputXML TEXT, outputXML
TEXT)" ;
statement.sqlConnection=connection;
statement.execute();

var statement = new SQLStatement();
statement.text="CREATE TABLE IF NOT EXISTS offlineRequest (ID
INTEGER PRIMARY KEY AUTOINCREMENT, action TEXT, inputXML TEXT)" ;
statement.sqlConnection=connection;
statement.execute();

}


This is very fast and effective too.

Thanks and Regards

Varun Rathore
+9216868410

Rahul

unread,
May 15, 2008, 7:38:21 AM5/15/08
to Delhi Flex User Group
nice post varun
thanks a lot for that..
Reply all
Reply to author
Forward
0 new messages