[flexcoders] Re: Adobe AIR - interimittent online/offline storage (à la Google Gears)

2010-08-09 Thread valdhor
I would set up a function with a try catch block that would try to connect with 
the server together with a timer that runs the function every few minutes. I 
would store the data locally in a SQL Lite database. Once you get a connection, 
sync the data.

--- In flexcoders@yahoogroups.com, mark.embrey mark.c.emb...@... wrote:

 What is the best way to to store data locally while offline and to 
 automatically detect a connection and sync local data with remote services?
 
 thanks!





[flexcoders] Re: Adobe AIR - interimittent online/offline storage (à la Google Gears)

2010-08-09 Thread seanmcmonahan



I have a similar setup for an app that needs to pull data from a server at 
certain times.  This is not generally critical so the server stuff needs to 
fail silently and allow the app to continue about it's business.

To do this I wrote a ServerMonitor class that wraps air.net.URLMonitor.  With 
URLMonitor you point it at a URL and the object will poll that URL for 
availability at whatever interval you set.  There is a StatusEvent that will be 
dispatched whenever availability changes.  All I do is listen for this event 
and do things in my app accordingly.


--- In flexcoders@yahoogroups.com, mark.embrey mark.c.emb...@... wrote:

 What is the best way to to store data locally while offline and to 
 automatically detect a connection and sync local data with remote services?
 
 thanks!