Giter Site home page Giter Site logo

news's Introduction

About

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.

Architectural Overview

This is a high-level design diagram of the application:

Architectural Overview

Branch Roadmap

Feature #1: Timeline and Details Views

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.

Feature #2: Networking and Navigation Drawer

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 and Media.java)
  • Display dates in a human-friendly format

Feature #3: Data Caching

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).

Dependencies

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 on FEAT-2)

Talking to the Backend

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.

news's People

Contributors

fed avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.