1. #1
    Sencha Premium Member
    Join Date
    Feb 2012
    Location
    Brisbane
    Posts
    244
    Vote Rating
    3
    SuperRoo is on a distinguished road

      0  

    Default offline design questions

    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 - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,330
    Vote Rating
    847
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      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 @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

Thread Participants: 1

Tags for this Thread