Your application may require the user to be connected to a network. This may be for partial updates, remote data transfer, or streaming. Using the PhoneGap API and network information plugin, we can easily detect the status or existence of any network connectivity.
In this recipe, we will build an application to constantly check the network connection status of our device:
networkinfoby running the following command:
phonegap create networkinfo com.myapp.networkinfo networkinfo
cordova platform add ios cordova platform add android