Chapter 11. Network communication with push notifications

 

This chapter covers

  • Detecting network information
  • Pushing notifications
  • Updating application tiles
  • Using URL associations

With the advent of smartphones, the way in which most mobile users use their phones has dramatically changed. The phone has become our constant companion and keeps us connected with family, friends, and coworkers. We use the phone to read news, check email, tweet on Twitter, post and read updates on Facebook, and play games. Most of the applications you’re using on your phone have one thing in common. Can you guess what it is? All of them access the network to retrieve the information stored in the cloud. Consuming resources from the network is crucial. As a developer of a mobile app, you need to understand how to efficiently consume network resources.

Networked applications need to know whether a network connection is available and, if so, what type of connection is enabled. We open this chapter by discussing how you can detect the network connection before consuming resources. We show how to detect whether the device is connected to a cellular data network or to a Wi-Fi access point or is in airplane mode.

11.1. Detecting network connectivity

11.2. Pushing notifications to a phone

11.3. Launching applications with the Installation Manager

11.4. Simulating a Push Notification Service

11.5. Summary