Application takes in a Json file and randomly prints out quotes from famous authors.
Use the file recentquotes.json to show random popular book quotes. Your program should use GSON to parse the .json file. The app needs no functionality other than showing the quote and the author when it is run. The app should choose one quote each time it is run.
All dependencies have been added to the application. Just run ./gradlew run to install proper dependencies.
GSON
Reading From Scanner
Parsing JSON File with GSON
Rather than using a hardcoded file of JSON data with quotes, you’ll grab quotes from an API and display those to the user.
When running the application, don’t read in the quotes file. Instead, make a request to an API to get a random quote.
Ensure that if your app has errors in connecting to the Internet, you instead display a random quote from your file.
Add that functionality: when a quote comes back from a request, it’s also cached in the json file.
StarWars Api
HTTP Request Java
- Nick Paro
- Matt Stuhring