View Full Version : detecting network connection in sencha
21 Dec 2010, 11:46 AM
Ii want to create an app which will first check if there is a connection to the internet.
If there is, then pull the latest information via a JSON feed..if not pull up data from localstorage..
how can i do this with sencha touch?
21 Dec 2010, 12:10 PM
// This property is true if you are online, false if not
Of course you'll need to do some extra work like spec'ing a cache-manifest to have whatever local assets you need available offline in the first place (aside from local storage for the data you want to display).
21 Dec 2010, 12:17 PM
afaik there is no api for it in st where you can check network.online?
but you can make the normal request and on failure callback (no network) you load the data from the local store
Powered by vBulletin® Version 4.1.5 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.