O'Reilly logo

Sencha Touch Cookbook - Second Edition by Ajit Kumar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Detecting offline mode

The life of an offline application starts with identifying whether the device/browser is online or offline and, based on that, taking the appropriate action. In this recipe we will see the different ways in which we can identify whether the device or the browser is online or offline, which will help us make decisions in the subsequent recipes. We will start with using Cordova API to detect the mode and then later look at other alternatives.

We have already set up our project with Cordova support as part of the setup in Chapter 1, Gear Up for the Journey. You may refer to http://cordova.apache.org/docs/en/ for more details on its APIs.

Getting ready

Make sure that you have set up your development environment by following the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required