Description
CS 442 Mobile Applications
Development (Android Section)
CS 442: Mobile Applications Development Assignment 5 – News Gateway (450 pts)
Uses: Service, Broadcasts & Receivers, Drawer Layout, Fragments, ViewPager, Internet, APIs
App Highlights:
• This app displays current news articles from a wide variety of news sources covering a range of news categories.
• NewsAPI.org will be used to acquire the news sources and news articles.
• Selecting a news source will display up to 10 top stories from that news source
• Selecting a news category will limit the news source choices to only those offering that category of news.
• News articles are viewed by swiping right to read the next article, and left to go back to the previous article
• You will not need to develop separate landscape layouts
• The user can go to the complete extended article on the news source’s website by clicking on the article title, text, or image content.
• You must add a professional looking launcher icon to your app.
Application Architecture:
© Christopher Hield
CS 442 Mobile Applications
Development (Android Section)
A) News Data:
Acquiring news source and news article data will be done via the NewsAPI.org news aggregation service. This service allows you to download news sources (all or by news type/category) and news articles (by news source)
NOTE: You MUST sign up get an API key in order to access the NewsAPI.org services. Your API KEY must be supplied with NewsAPI.org queries. You can do this by registering at:
https://newsapi.org/register
Register with an email and a new password and agree to the terms and click Submit to register and get your API key (the key is displayed to you right after you click the Submit button).
The API:
The NewsAPI.org service offers 2 API calls – one to get news sources (organizations offering news – CNN, Time, etc.) and one to get top news articles from a selected news source.
1) News Sources Query Format (to be used in our assignment):
To get all sources:
https://newsapi.org/v2/sources?language=en&country=us&category=________&apiKey=________
Note, using an empty string for the category will return source for all categories.
For example, if your category was “business” and your API Key was “ABC123xyz”, the URL would be:
https://newsapi.org/v2/sources?language=en&country=us&category= business &apiKey= ABC123xyz
2) News Article Query Format (to be used in our assignment):
https://newsapi.org/v2/everything?sources=______&language=en&pageSize=100&apiKey=______
For example, if your API Key was “ABC123xyz” and you wanted “cnn” news, the URL would be:
https://newsapi.org/v2/everything?sources=cnn&language=en&pageSize=100&apiKey= ABC123xyz
© Christopher Hield
CS 442 Mobile Applications
Development (Android Section)
NewsAPI.org Sources Query Results Example:
https://newsapi.org/v2/sources?language=en&country=us&category=&apiKey= ABC123xyz
The results come in the form of a JSON Object that contains a JSON Array of source entries as shown below. Each entry represents an individual news source. Example:
{
“status”: “ok”,
“sources”: [{
“id”: “abc-news”,
“name”: “ABC News”,
“description”: “Your trusted source for breaking news, analysis, exclusive interviews, headlines, and videos at ABCNews.com.”,
“url”: “https://abcnews.go.com”,
“category”: “general”,
“language”: “en”,
“country”: “us”
}, {
“id”: “al-jazeera-english”,
“name”: “Al Jazeera English”,
“description”: “News, analysis from the Middle East and worldwide, multimedia and interactives, opinions, documentaries, podcasts, long reads and broadcast schedule.”,
“url”: “http://www.aljazeera.com”,
“category”: “general”,
“language”: “en”, “country”: “us”
}, {
“id”: “ars-technica”,
“name”: “Ars Technica”,
“description”: “The PC enthusiast’s resource. Power users and the tools they love, without computing religion.”,
“url”: “http://arstechnica.com”,
“category”: “technology”,
“language”: “en”,
“country”: “us”
}, {
. . .
}]
}
© Christopher Hield
CS 442 Mobile Applications
Development (Android Section)
NewsAPI.org Articles Query Results Example:
https://newsapi.org/v2/everything?sources=cnn&language=en&pageSize=100&apiKey= ABC123xyz
The results come in the form of a JSON Object that contains a JSON Array of article entries as shown below. Each entry represents an individual news article. Example:
{
“status”: “ok”,
“totalResults”: 4773,
“articles”: [{
“source”: {
“id”: “cnn”,
“name”: “CNN”
},
“author”: “Kristina Marusic, CNN”,
“title”: ” Anatomy of a Pride parade “,
“description”: ” Pride parades have been with us for decades now. Let’s look back at their history and the wide variety of people — from drag queens to church representatives — who are in them.”,
“url”: ” https://www.cnn.com/travel/article/pride-parades-history/index.html”,
}, {
“source”: {
“id”: “cnn”,
“name”: “CNN”
},
“author”: null,
“description”: ” Today is the last day for campaigns to file Federal Election
Commission disclosure reports with full details of their fundraising. Follow here as we learn the candidates’ first-quarter fundraising totals.”,
“url”: ” https://www.cnn.com/politics/live-news/first-quarter-fundraising-totals-04-1519/index.html”,
and congressional candidates to file reports with the Federal Election Commission, detailing their fundraising and spending during the first three months of the year. This marks the fir… [+910 chars] ”
}, { . . .
}]
}
© Christopher Hield
CS 442 Mobile Applications
Development (Android Section)
B) Application Behavior Diagrams:
1) Overview
© Christopher Hield
CS 442 Mobile Applications
Development (Android Section)
3) Swipe Right (or Left) to scroll through articles from the selected new source:
© Christopher Hield
CS 442 Mobile Applications
Development (Android Section)
4) Select a news category from the options menu to limit the news source choices to only those offering that category of news.
5) Click on article content to go to extended article on the news source web site
© Christopher Hield
CS 442 Mobile Applications
Development (Android Section)
C) Application Content:
D) Extra Credit:
1) Up to 20 points of extra credit will be awarded if you save and restore the app state when transitioning between portrait and landscape layouts to ensure a smooth user experience. Without this, the app reverts to the start state upon rotation. If this is done properly, the current category selection, the current source list (in the drawer), and the displayed articles will be maintained upon device orientation change.
© Christopher Hield
CS 442 Mobile Applications
Development (Android Section)
2) Up to 25 points of extra credit will be awarded if you display the news categories in the options menu different colors, and then color the news sources in the drawer according to their category:
Options menu example: Drawer list of news sources: example
Assignment Assistance
Submissions & Grading
1) Submissions must consist of your zipped project folder (please execute Build =>Clean Project before generating the zip file).
2) Submissions should reflect the concepts and practices we cover in class, and the requirements specified in this document.
4) Grading will be based upon the presence and proper functionality of all features and behaviors described in this document.
© Christopher Hield
CS 442 Mobile Applications
Development (Android Section)
NOTE
This assignment is worth 450 points. This means (for example) that if you get 89% on this assignment, your recorded score will be: (89% * 450 points = 401 points)
If you do not understand anything in this handout, please ask.
Otherwise the assumption is that you understand the content.
Unsure? Ask!
© Christopher Hield 10 of 10




Reviews
There are no reviews yet.