开发者

Displaying Web data, not web page, in Android

开发者 https://www.devze.com 2023-01-22 20:10 出处:网络
I need display data from a web page in a ListView, for example if I were to send a request to a time server for the U.S. time zone\'s tim开发者_高级运维es and the web server responded with an HTML web

I need display data from a web page in a ListView, for example if I were to send a request to a time server for the U.S. time zone's tim开发者_高级运维es and the web server responded with an HTML web page that contained the current time's of each zone and a small icon image of each geographic region time zone, what steps would I need to take to put that data into a ListView?

For example, if I use http to communicate with the time server, it will respond with an http response, will I have to somehow extract the HTML from the response and find the image of the geographic region as well as the text for the current time? Is there a better way to do something like this?


Send the http request Save the response (in memory, a string probably) parse the response display the parsed data

will I have to somehow extract the HTML from the response

How else would you do it?

Is there a better way to do something like this?

Find a site that offers an API


Make the Android problem a separate problem, by setting up a small server-side web application that does the teasing apart information for you, and then only deal with the JSON or XML that you cook up for your mobile app.

0

精彩评论

暂无评论...
验证码 换一张
取 消