In the previous chapter, we learned how to communicate with the backend database using a Cordova/PhoneGap app. However, even in an increasingly connected world, mobile devices aren't always connected to the network. As such, our app needs to be sensitive to changes in the device's network connectivity. It also needs to be sensitive to the type of network (for example, cellular versus wired), not to mention being sensitive to the device the app itself is running on.
Given all this, in this chapter, we'll cover the following topics:
Determining network connectivity
Getting the current network type
Detecting changes in connectivity
Handling connectivity issues
Handling changes in the application state
Responding to application-level events
Storing local data using SQLite
Storing data in the iOS Keychain