GithubHelp home page GithubHelp logo

article-browser's Introduction

Article Browser

A simple article browser for Android using public APIs

It reads from RESTful HTTP APIs and displays the data

The application is constructed using a tried-and-true MVP architecture, utilizing presenters (instead of the more common ViewModels) to express business logic. Data is technically bi-directional, as it is with virtually all architectures, but all possible interactions are eagerly handled in the single present() function of each screen, bringing the application closer to unidirectional data flow, which in reality is, of course, a lie.

The application components themselves are simply two activities. Since the two views always occupy separate screens, there is no need for the more complex fragments. Also, as of 2023, multiple activites can be displayed on a single screen if necessary.

The application code illustrates mostly basic language semantics, with some more advanced features such as higher order functions, and includes unit tests that show how to exercise them.

The app uses Coroutines for asynchronous work management, Hilt for dependency injection, retrofit for HTTP operations, Moshi for JSON parsing, and JUnit + Mockito for unit testing.

The application was written entirely from scratch, relying on no existing application as a bootstrap.

Trade Offs:

To save time, I made several sacrifices.

  1. The app's UI is simple, and somewhat inconsistent.
  2. I didn't unit test all the business logic, and instead simply wrote some tests to illustrate the art of unit testing.
  3. I used XML in lieu of Compose, since I'm more familiar with XML and can build XML layouts faster and cleaner currently than I can in Compose.
  4. I also used MVP, which most Android devs never bother to even learn, even though the entire Android ecosystem is setup to support MVVM. Again this is bc MVP is currently fresher in my mind and was faster to implement.
  5. There is no API Error handling. If the API fails, the app will crash
  6. There is no good solution for the All-leagues option. I tried to make all the calls in parallel, but that causes the API to timeout. So, to make it work, I call for each league's articles in series, which takes forever.

article-browser's People

Contributors

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