Wednesday, May 4, 2011

Create HTTP connection in Android and get input and output Streams


String PROFILE_SERVER_URL="http://your-erver-URL";
URL url = new URL(BF_PROFILE_SERVER_URL);
URLConnection urlConnection = url.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setDoInput(true);
urlConnection.connect();
OutputStream out = urlConnection.getOutputStream();
XmlWriter writer = new XmlWriter(out);
InputStream in = urlConnection.getInputStream();
BufferedReader reader1 = new BufferedReader(new InputStreamReader(in));


No comments:

Post a Comment