Results 1 to 2 of 2

Thread: offline design questions

  1. #1
    Sencha Premium Member
    Join Date
    Feb 2012
    Location
    Brisbane
    Posts
    246
    Vote Rating
    4
      0  

    Default offline design questions

    Hi,
    I am creating an app that will be native packaged as it requires to be run when out of phone coverage.I thought of caching and localstore but need to be told when going on/off line. I have got the sections where it goes to localstore if offline and synchs localstore if online. From the docs, you can add an onlinechange event:
    Code:
    Ext.device.Connection.on({
           // scope: this,
            onlinechange: this.onlineChange
        });
    
      onlineChange: function (online, type) {
            alert(online + type);
        },
    but have been told that this will only work when native packaged as the event relies on the device.
    Also, if this event fires in the middle of doing dome other work (e.g. entering data or taking picture via app) will the other work freeze while the online function completes or is there a way to do the online updates in the background?
    So 3 questions:
    1. Do I have to package to get the event?
    2. Can I run the online function in the background?
    3. Is there a better way to do this.
    Thanks

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Vote Rating
    1272
      0  

    Default

    To get an event yes you need to be packaged but for offline you do not. You can check navigator.onLine to see if the device is online.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •