Android - 如何从网页使用XML Feed?

时间:2017-03-08 08:40:52

标签: android json xml

今天我遇到了一个新的挑战,即将来自网页的XML Feed整合到我的应用中。

问题是,我不确定这是否是XML:

get leagues from file
league ID: 1
load scores file
updating live fixtures
string(14) "No live scores"
object(SimpleXMLElement)#20 (1) {
["AccountInformation"] => string(136) "Data requested at 3/8/2017 9:32:47 AM from XXX.XX.XX.XX, Username: XXXXXX. Your current supscription runs out on 2/28/2018 5:02:25 PM."
}
no live matches
league ID: 4
load scores file
updating live fixtures
string(14) "No live scores"
object(SimpleXMLElement)#19 (1) {
  ["AccountInformation"] => string(136) "Data requested at 3/8/2017 9:32:47 AM from XXX.XX.XX.XX, Username: XXXXXX. Your current supscription runs out on 2/28/2018 5:02:25 PM."
}
no live matches
league ID: 10
load scores file
updating live fixtures
string(14) "No live scores"
object(SimpleXMLElement)#18 (1) {
  ["AccountInformation"] => string(136) "Data requested at 3/8/2017 9:32:47 AM from XXX.XX.XX.XX, Username: XXXXXX. Your current supscription runs out on 2/28/2018 5:02:25 PM."
}
no live matches

如何使用此Feed显示足球比赛的实时比分? 我真的不知道从哪里开始?

1 个答案:

答案 0 :(得分:0)

使用Jsoup库它可以帮助您从网页获取数据。 https://jsoup.org/download

这是教程如何在Android中使用 http://www.androidbegin.com/tutorial/android-basic-jsoup-tutorial/

希望它会对你有所帮助。