Deadline: Thursday, May 1, 23:59pm
URL: https://www.crowdgrader.org/crowdgrader/venues/view_venue/332
For Homework 2, you have to produce an app with two activities.
The first activity should display a list of news web sites, and allow you to choose which to read. You should get the list of web sites by accessing the URL:
(Try it, the link is live).
You get a Json reply, here is an example:
{"sites": [{"url": "http://www.nytimes.com", "title": "The New York Times"}, {"url": "http://www.losaltosonline.com/", "title": "Los Altos Town Crier"}, {"url": "http://www.theonion.com", "title": "The Onion"}, {"title": "Ghost News"}, {"url": "http://www.hmbreview.com/", "title": "Half Moon Bay Review"}, {"url": "http://www.washingtonpost.com", "title": "The Washington Post"}]}
You need to parse this reply. Note that the sites may change in time, and note that the reply may be malformed; do recover from errors. Also note that what you get is variable-length.
The activity should display a list (using a ListView). Each list element should contain the title of the site (as given in the Json you got from the above URL), and a button labeled "Read".
When you press a "Read" button in the first activity, you are sent to the second activity. Here, a WebView should be displayed.
The WebView should display the news site you chose. As long as you navigate within that domain name, your navigation should happen in the WebView. If you follow a link outside of that news domain, the link should be handled by the normal browser.
Somewhere, either in the action bar, or as a physical button that you place somewhere, you should give people the option of quickly going back from the Read Activity to the Choice Activity.
Here are some things to which you should pay attention: