Skip to content

Most visited

Recently visited

navigation

Performing Network Operations

Dependencies and prerequisites

  • Android 1.6 (API level 4) or higher
  • A device that is able to connect to mobile and Wi-Fi networks

You should also read

Try it out

  1. Android BasicNetworking Sample

This class explains the basic tasks involved in connecting to the network, monitoring the network connection (including connection changes), and giving users control over an app's network usage. It also describes how to parse and consume XML data.

This class includes a sample application that illustrates how to perform common network operations. You can view the sample on GitHub (see the link under Try it out) and use it as a source of reusable code for your own application.

By going through these lessons, you'll have the fundamental building blocks for creating Android applications that download content and parse data efficiently, while minimizing network traffic.

Note: See the class Transmitting Network Data Using Volley for information on Volley, an HTTP library that makes networking for Android apps easier and faster. Volley is available on GitHub. Volley may be able to help you streamline and improve the performance of your app's network operations.

Lessons

Connecting to the Network
Learn how to connect to the network, choose an HTTP client, and perform network operations outside of the UI thread.
Managing Network Usage
Learn how to check a device's network connection, create a preferences UI for controlling network usage, and respond to connection changes.
Parsing XML Data
Learn how to parse and consume XML data.
This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Follow Google Developers on WeChat

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a short survey?
Help us improve the Android developer experience.
(Sep 2017 survey)