You will probably find it hard to get an app that doesn't communicate over the network. Communication with the internet is used in almost all the apps, be it a file-sharing app, streaming app, social network apps, or something else, the list goes on and on. There are many variables that you need to think about when you want to add network communication features to your Android apps. For example, you can't run it on the main thread, and network requests are always performed on background threads. Apart from that, you also need to detect when the network request fails, so as to give feedback to the user about what went wrong. In this chapter, we will address how to efficiently make network requests in Kotlin.
Germany
Slovakia
Canada
Brazil
Singapore
Hungary
Philippines
Mexico
Thailand
Ukraine
Luxembourg
Estonia
Lithuania
Norway
Chile
United States
Great Britain
India
Spain
South Korea
Ecuador
Colombia
Taiwan
Switzerland
Indonesia
Cyprus
Denmark
Finland
Poland
Malta
Czechia
New Zealand
Austria
Turkey
France
Sweden
Italy
Egypt
Belgium
Portugal
Slovenia
Ireland
Romania
Greece
Argentina
Malaysia
South Africa
Netherlands
Bulgaria
Latvia
Australia
Japan
Russia