tags:

views:

171

answers:

2

how to connect and retrive data from one webserver through coding in android application?

How to achieve this ? Give me sample code for this

+4  A: 

One way is using HttpClient, and there are examples from Apache. Also see this blog post for an Android specific example.

Mike Mazur
A: 

If the java.net package is available on Android, you can use the URL class.

import java.net.*;

...

URL url = new URL("http://example.com/whatever");
return (String) url.getContent();
codeape