从android中的网站获取特定信息
我想编写一个程序,从此链接获取比赛日期 http://www.goal.com/en/teams/germany/148/fc-bayern-munich-news 并在我的程序中使用它,我只想要日期和比赛,我该怎么做?在安多里德
i want to write a program that gets the match dates from this link http://www.goal.com/en/teams/germany/148/fc-bayern-munich-news
and use it in my program i just want the dates and the matches how can i do this? in andorid
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我会写一个
Activity
到显示数据,它调用AsyncTask
连接到站点并下载 HTML。然后我会使用某种解析器来获取我想要的数据并将其保存到 数据库。您以前写过 Java 吗?如果没有,我会从学习语言开始。下载 Eclipse 并编写一个简单的程序,可以连接到该站点并获取 HTML。然后添加解析器。
完成此操作后,请执行 Hello World 教程,然后开始工作您可以按照其他教程的方式进行操作。另请了解 Android 应用程序生命周期。此时,您可以开始考虑将代码移至 Android 框架。
编辑
以下是一些有关潜在解析器和解析器的信息的链接。解析方法。
您还可以考虑使用(静音)正则表达式/模式匹配。
I'd write an
Activity
to display the data, which calls anAsyncTask
to connect to the site and download the HTML. I'd then use some kind of parser to grab the data I want and save it to a database.Have you written Java before? If not I'd start out by learning the language. Download Eclipse and write a simple program that can connect to the site and grab the HTML. Then add the parser.
Once you are that far, do the Hello World tutorial, then work your way through the other tutorials. Also learn about the Android Application Lifecycle. At that point you can start thinking about moving your code over to the Android framework.
EDIT
Here are some links to information about potential parsers & parsing approaches.
You could also consider using (hushed voice) regex/pattern matching.