In this chapter, you will be taught how to communicate with internet servers and with sockets in general. First, we will take a look at QNetworkAccessManager, which makes sending network requests and receiving replies really easy. Building on this basic knowledge, we will then use Google's Distance API to get information about the distance between two locations and how long it would take to get from one to the other. This technique, and the respective knowledge, can also be used to include Facebook or Twitter in your application via their respective APIs. Then, we will take a look at Qt's Bearer API, which provides information about a device's connectivity state. In the last section, you will learn how to use sockets to create your own server and clients using TCP or UDP as the network protocol.
The main topics covered in this chapter are the following...