Android examples for Network:Network Operation
load Xml From Network URL
//package com.java2s; import java.io.IOException; import java.io.InputStream; import java.net.HttpURLConnection; import java.net.URL; public class Main { public static InputStream loadXmlFromNetwork(String urlString) throws IOException { URL url = new URL(urlString); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.setReadTimeout(10000);/*from w ww . j a va 2 s . co m*/ conn.setConnectTimeout(15000); conn.setRequestMethod("GET"); conn.setDoInput(true); conn.connect(); return conn.getInputStream(); } }