Scott Main | 50e990c | 2012-06-21 17:14:39 -0700 | [diff] [blame] | 1 | page.title=Performing Network Operations |
Scott Main | 7d711b1 | 2013-03-11 13:52:35 -0700 | [diff] [blame] | 2 | page.tags="network","wireless" |
Scott Main | 50e990c | 2012-06-21 17:14:39 -0700 | [diff] [blame] | 3 | |
| 4 | trainingnavtop=true |
| 5 | startpage=true |
| 6 | next.title=Connecting to the Network |
| 7 | next.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" |
| 34 | class="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, |
| 42 | monitoring the network connection (including connection changes), and giving |
| 43 | users control over an app's network usage. It also describes how to parse and |
| 44 | consume XML data.</p> |
| 45 | |
| 46 | <p>This class includes a sample application that illustrates how to perform |
| 47 | common network operations. You can download the sample (to the right) and use it |
| 48 | as a source of reusable code for your own application.</p> |
| 49 | |
| 50 | <p>By going through these lessons, you'll have the |
| 51 | fundamental building blocks for creating Android applications that download |
| 52 | content 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 |
| 62 | network 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 |
| 67 | device's network connection, create a preferences UI for controlling network |
| 68 | usage, 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 | |