News App - project from Android Basics by Google Nanodegree Program in Udacity
The goal is to create a News feed app which gives a user regularly-updated news from the internet related to a particular topic, person, or location. The presentation of the information as well as the topic is up to you.
This project is about combining various ideas and skills we’ve been practicing throughout the course. They include:
- Connecting to an API
- Parsing the response of the API
- Handling error cases gracefully
- Updating information regularly
- Doing network operations independent of the Activity lifecycle
CRITERIA / MEETS SPECIFICATIONS
Layout
Main Screen / App contains a main screen which displays multiple news stories
List Item Contents / Each list item on the main screen displays relevant text and information about the story. Required fields include the title of the article and the name of the section that it belongs to. If available, author name and date published should be included. Please note not all responses will contain these pieces of data, but it is required to include them if they are present.
Layout Best Practices / The code adheres to all of the following best practices:
- Text sizes are defined in sp
- Lengths are defined in dp
- Padding and margin is used appropriately, such that the views are not crammed up against each other.
Functionality
Main Screen Updates / Stories shown on the main screen update properly whenever new news data is fetched from the API.
Errors / The code runs without errors.
Story Intents / Clicking on a story opens the story in the user’s browser.
Api Query / App queries the content.guardianapis.com api to fetch news stories related to the topic chosen by the student, using either the ‘test’ api key or the student’s key.
Use of Loaders / Networking operations are done using a Loader rather than an AsyncTask.
External Libraries and Packages / The intent of this project is to give you practice writing raw Java code using the necessary classes provided by the Android framework; therefore, the use of external libraries for the core functionality will not be permitted to complete this project.
Code Readability
Readability / Code is easily readable such that a fellow programmer can understand the purpose of the app.
Naming conventions / All variables, methods, and resource IDs are descriptively named such that another developer reading the code can easily understand their function.
Formatting / The code is properly formatted i.e. there are no unnecessary blank lines; there are no unused variables or methods; there is no commented out code. The code also has proper indentation when defining variables and methods.