1<?xml version="1.0" encoding="UTF-8"?> 2<!-- 3 Copyright 2013 The Android Open Source Project 4 5 Licensed under the Apache License, Version 2.0 (the "License"); 6 you may not use this file except in compliance with the License. 7 You may obtain a copy of the License at 8 9 http://www.apache.org/licenses/LICENSE-2.0 10 11 Unless required by applicable law or agreed to in writing, software 12 distributed under the License is distributed on an "AS IS" BASIS, 13 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 See the License for the specific language governing permissions and 15 limitations under the License. 16--> 17<sample> 18 <name>NetworkConnect</name> 19 <group>Connectivity</group> 20 <package>com.example.android.networkconnect</package> 21 22 23 24 <!-- change minSdk if needed--> 25 <minSdk>8</minSdk> 26 27 28 <strings> 29 <intro> 30 <![CDATA[ 31 This sample demonstrates how to connect to the network and fetch raw HTML using 32 HttpURLConnection. AsyncTask is used to perform the fetch on a background thread. 33 ]]> 34 </intro> 35 </strings> 36 37 <template src="base"/> 38 <common src="logger"/> 39 40 <metadata> 41 <status>PUBLISHED</status> 42 <categories>Connectivity</categories> 43 <technologies>Android</technologies> 44 <languages>Java</languages> 45 <solutions>Mobile</solutions> 46 <level>INTERMEDIATE</level> 47 <icon>screenshots/icon-web.png</icon> 48 <screenshots> 49 <img>screenshots/main.png</img> 50 </screenshots> 51 <api_refs> 52 <android>android.os.AsyncTask</android> 53 </api_refs> 54 55 <description> 56 <![CDATA[ 57This sample demonstrates how to connect to the network and fetch raw HTML using 58HttpURLConnection. AsyncTask is used to perform the fetch on a background thread. 59 ]]> 60 </description> 61 62 <intro> 63 <![CDATA[ 64This sample application demonstrates how to connect to the network and fetch raw 65HTML. It uses AsyncTask, a background task manager, to perform the network fetch 66on a background thread. By using AsyncTask, the app can avoid hanging on the UI 67thread, and instead update the UI when the response is ready. To establish the 68network connection, the sample uses HttpURLConnection. 69 ]]> 70 </intro> 71 </metadata> 72 73</sample> 74