This is a simple, minimal news application for online magazines and newspapers. Our News app consumes all of the data it needs from this RESTful API.
This is a high-level design diagram of the application:
Branch codename:
FEAT-1
Link to Pull Request: https://github.com/fknussel/News/pull/1
So far the application is somewhat limited in functionality, the user can just browse all of the news in the news feed, and see an extended version for each post when clicking on it. This branch focuses mainly on introducing appearance changes on both main activity (news feed) and detail activity.
- Basic Navigation drawer with categories
- ActionBar menu options
- Material design color scheme
- Timeline layout
- ImageView with rounded corners on news feed
Side note: in order to test basic functionality, data sources have been mocked using the getDummyPosts()
method implemented in the Post.java
model class.
Branch Codename:
FEAT-2
Link to Pull Request: https://github.com/fknussel/News/pull/2
This branch introduces networking capabilities using Retrofit, allowing the app to fetch the latest posts from the RESTful API.
- Improved Navigation drawer with categories
- Fetch latest posts from remote API
- Model classes definition (
Post.java
andMedia.java
) - Display dates in a human-friendly format
Branch Codename:
FEAT-3
Link to Pull Request: https://github.com/fknussel/News/pull/3
So far, whenever we want to display a particular post or list the latest articles, we needed to query the API. This is not cool whatsoever, unnecessary network calls should be avoided whenever possible. Instead we should cache the data into our local database immediately after we query the web service for the first time. This is what this branch focuses on, making the app more efficient in terms of network calls.
We also went ahead and made some UI tweaks to DetailActivity
: the action bar is now transparent, the pictures kinda overlay the action bar but are still fully visible since it's transparent now, also posts' titles get displayed on top of a black-to-transparent gradient applied to the image (we are no longer using the semi-opaque black box underneath the title).
This application uses the following libraries:
- Picasso for remote image loading and manipulation (added on
FEAT-1
) - Retrofit as a way of interfacing our RESTful API (added on
FEAT-2
) - GSON to convert Java Objects into their JSON representation, as well as to convert JSON strings to their equivalent Java objects (added on
FEAT-2
) - DATE4J for date manipulation, as an alternative to
Date
,Calendar
and related Java classes (added onFEAT-2
)
This app is tightly-knit to the RESTful API it gets its data from. The model classes (Post.java
, Media.java
and so on) were built upon the API's interfaces. Go check the web service source code to get an insight of how this all works together.
The location of the RESTful API is hardcoded in this class:
public class ApiClient {
private static final String API_URL = "http://api.fknussel.com";
Heads up! โ DO NOT include a trailing slash here.