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
I'd write an Activity
to display the data, which calls an AsyncTask
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.
- Tag Soup
- What HTML parsing libraries do you recommend in Java
- Two HTML parsing links
You could also consider using (hushed voice) regex/pattern matching.
精彩评论