Chapter 9. Network communication with push notifications and sockets

 

This chapter covers

  • Detecting network information
  • Pushing notifications
  • Updating application tiles
  • Communicating with sockets

In the past few years, the way that most mobile users use their phones has dramatically changed. The mobile phone has become our constant companion and helps keep us connected with family, friends, and coworkers. We use the phone to read news, check emails/twitter/Facebook, post updates, and play games. Most of the applications that you’re using on your phone have one thing in common. Can you guess what it is? All those applications access the network to retrieve the information stored in the cloud. Consuming resources from the network is crucial even for a normal mobile user. As a developer who is developing an application for mobile devices, 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 up this chapter by discussing how you can detect the network connection before consuming resources. We show you how to detect whether the device is connected to a cellular data network or a Wi-Fi access point, or whether the device is in airplane mode.

9.1. Detecting network connectivity

 
 
 

9.2. Pushing notifications to a phone

 

9.3. Simulating a push notification service

 

9.4. Tiles without all the pushiness

 
 
 
 

9.5. Communicating with sockets

 
 
 
 

9.6. Implementing a chat application with TCP sockets

 
 
 

9.7. Summary

 
 
sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage
test yourself with a liveTest