MAP524/DPS924 Lab 7

From CDOT Wiki
Jump to: navigation, search

Due: in the lab period, need professor sign-off.

In the lab this week you'll be using the Android XML Pull Parser to parse some XML returned from a web service. You can start from this example which is mostly unmodified from your textbook: MyNetworkingText.zip

  1. Open the project. Because your environment is different from mine the project will need some minor changes, which Android Studio should help you with.
  2. You should be able to compile and run the program, it will:
    • Start a thread for the network operation
    • Retreive the definition for the word 'Apple' from a web service
    • Parse the results using the DOM parser
    • Displays the results in a textview
  3. You can study the DOM parser implementation if you like, but it won't help you much when implementing the algorithm using the Pull Parser. You'll pretty much have to rewrite the entire WordDefinition() function.
  4. Once you're done the result should look identical as the original to the user. It will do the same thing but use a different parsing method.

As you work on the lab - pay attention to the networking parts as well. You don't need to change them for the lab but you should know how to do that sort of stuff.