Chapter 7. Networking
In this chapter, you will be taught how to communicate with the Internet servers and with sockets in general. First, we will have a look at
QNetworkAccessManager
, which makes sending network requests and receiving replies really easy. Building on this basic knowledge, we are then going to 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 have a look at Qt's Bearer API, which provides information on 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.