Reputation: 11
I am new to android development, and would like to do an application that pulls data from a server, is there any straight-forward and to the point tutorial that I can use?
Upvotes: 1
Views: 312
Reputation: 887
You can use this method to pick data from server then you convert the inputs trim to string then you can parse for further use.`
public static InputStream getUrlData(final String url)
throws URISyntaxException, ClientProtocolException, IOException {
final DefaultHttpClient client = new DefaultHttpClient();
final HttpGet method = new HttpGet(new URI(url));
final HttpResponse res = client.execute(method);
return res.getEntity().getContent();
}
`
Upvotes: 1
Reputation: 466
You can use DefaultHttpClient for this approach.
Take a look at this
Upvotes: 0
Reputation: 503
its easy to do that with Andorid, just use a rest service and you are on your way
http://www.vogella.com/articles/AndroidJSON/article.html
Upvotes: 0