Tuesday:
How are the dates Nov. 14 and Nov. 19 for the two-part Test 2?
The homework posted above uses an Alert Dialog like that shown in the code below.
Lab 18. Nobel API Lab
The Nobel Prize site has a simple and free API (that also does not require an API key).
(https://www.nobelprize.org/nobel_organizations/nobelmedia/nobelprize_org/developer/
For example the (prize) url
http://api.nobelprize.org/v1/prize.json?category=medicine&year=1990
yields the json
{"prizes":[{"year":"1990","category":"medicine","laureates":[{"id":"442","firstname":"Joseph E.","surname":"Murray","motivation":"\"for their discoveries concerning organ and cell transplantation in the treatment of human disease\"","share":"2"},{"id":"443","firstname":"E. Donnall","surname":"Thomas","motivation":"\"for their discoveries concerning organ and cell transplantation in the treatment of human disease\"","share":"2"}]}]}
and the (laureate) url
http://api.nobelprize.org/v1/laureate.json?id=442
yields the json
{"laureates":[{"id":"442","firstname":"Joseph E.","surname":"Murray","born":"1919-04-01","died":"2012-11-26","bornCountry":"USA","bornCountryCode":"US","bornCity":"Milford, MA","diedCountry":"USA","diedCountryCode":"US","diedCity":"Boston, MA","gender":"male","prizes":[{"year":"1990","category":"medicine","share":"2","motivation":"\"for their discoveries concerning organ and cell transplantation in the treatment of human disease\"","affiliations":[{"name":"Brigham and Women's Hospital","city":"Boston, MA","country":"USA"}]}]}]}
Design an app that allows the user to enter a category (physics, chemistry, medicine, peace, literature
or economics) -- probably a spinner or set of radio buttons -- and a year. Then concatenate the corresponding
URL, read the JSON (remotely), parse it and display the first and last names of the laureates (AN ARRAY) as
well as the motivation.
Note that the URL's start with http and not https
The categories can be a a simple array in java or xml. For an additional challenge one can get the categories from the
json for all prizes.
Due: Nov. 12