blob: cb3a3907d0c68b800ea05e08ba4d3c42d65c0370 [file] [log] [blame]
Scott Main50e990c2012-06-21 17:14:39 -07001page.title=Performing Network Operations
Scott Main7d711b12013-03-11 13:52:35 -07002page.tags="network","wireless"
Scott Main50e990c2012-06-21 17:14:39 -07003
4trainingnavtop=true
5startpage=true
6next.title=Connecting to the Network
7next.link=connecting.html
8
9@jd:body
10
11<div id="tb-wrapper">
12<div id="tb">
13
14
15<h2>Dependencies and prerequisites</h2>
16<ul>
17 <li>Android 1.6 (API level 4) or higher</li>
18 <li>A device that is able to connect to mobile and Wi-Fi networks</li>
19</ul>
20
21
22<h2>You should also read</h2>
23<ul>
24 <li><a href="{@docRoot}training/monitoring-device-state/index.html">Optimizing Battery Life</a></li>
25 <li><a href="{@docRoot}training/efficient-downloads/index.html">Transferring Data Without Draining the Battery</a></li>
26 <li><a href="{@docRoot}guide/webapps/index.html">Web Apps Overview</a></li>
27</ul>
28
29
30<h2>Try it out</h2>
31
32<div class="download-box">
33 <a href="{@docRoot}shareables/training/NetworkUsage.zip"
34class="button">Download the sample</a>
35 <p class="filename">NetworkUsage.zip</p>
36</div>
37
38</div>
39</div>
40
41<p>This class explains the basic tasks involved in connecting to the network,
42monitoring the network connection (including connection changes), and giving
43users control over an app's network usage. It also describes how to parse and
44consume XML data.</p>
45
46<p>This class includes a sample application that illustrates how to perform
47common network operations. You can download the sample (to the right) and use it
48as a source of reusable code for your own application.</p>
49
50<p>By going through these lessons, you'll have the
51fundamental building blocks for creating Android applications that download
52content and parse data efficiently, while minimizing network traffic.</p>
53
54
55
56<h2>Lessons</h2>
57
58<dl>
59 <dt><b><a href="connecting.html">Connecting to the Network</a></b></dt>
60
61 <dd>Learn how to connect to the network, choose an HTTP client, and perform
62network operations outside of the UI thread.</dd>
63
64 <dt><b><a href="managing.html">Managing Network Usage</a></b></dt>
65
66 <dd>Learn how to check a
67device's network connection, create a preferences UI for controlling network
68usage, and respond to connection changes.</dd>
69
70 <dt><b><a href="xml.html">Parsing XML Data</a></b></dt>
71 <dd>Learn how to parse and consume XML data.</dd>
72
73</dl>
74