How to stream data and resources from a website
This is very naive... but how do you stream certain bits of information from a website. From what I understand webview launches a web page, but what if I want to only stream a par开发者_JAVA技巧agraph that was published on a site.
Example: Yahoo! Fantasy Football... Updates on players and the news feed about them.
This is obviously a lot more complicated than my question. I would be interested in a tutorial that could walk me through this. Does this also take programming on the server side to send this out? Thank you in advance.
If the site has an API where their data is available in a easy-to-use-in-an-application format, such as JSON or XML, then you should be able to just get the data over HTTP and then parse it and use it in your application. This might be a reasonably good place to start: http://developer.android.com/reference/org/apache/http/client/HttpClient.html
You could open up a file stream and download the entire html file then parse through it with SAX till you find the data you want and display it. Only problem with this is if they change there website it could break your app.
精彩评论