GithubHelp home page GithubHelp logo

mayank-amr / news Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 3.76 MB

In this project, I built an android app to discover popular and recent News Headlines. I built clean UI, sync to a server, and present detailed information of each News Headline, allowing users to 'favorite' News Article.

Kotlin 100.00%
news-headlines room pager offline retrofit coroutines kotlin-android material-design kotlin kotlin-flow-paging mvvm-architecture rest-api

news's Introduction

News

In this project, I built an android app to discover popular and recent News Headlines. I built clean UI, sync to a server, and present detailed information of each News Headline, allowing users to 'favorite' News Article.

NOTE:

To run this app, you must also have an API Key defined as a variable named API_KEY in the file ArticleMediator.kt located at com.mayank_amr.news.data.repository.paging package.

Specifications:

  • List of Top Headlines Country: India Default Tag: Technology, where 'Tags' represent 'Category' in the API. All categories in API docs are present in horizontally scroll.
  • Sorted news by latest on top.
  • Clicking on different tags should result in headlines from appropriate categories.
  • Clicking Card Opens Detail Screen.

Used:

  • Used Pagination - lazy load at the end of every 10 cards.
  • Used Room DB for saving favourites => Favourites should also be categorized by tags.
  • Used Room DB for caching logic - Once cached, should work offline without network.
  • Cached workflow works as same as online workflow .i.e., tag categorization with the cached data.
  • Used Retrofit and Kotlin Flow for networking [and] to observe changes in Room and update the UI.

Edge workflow:

  • Open app when offline => load cached data => scroll to bottom => turn on network => auto paginates.
  • Maintained proper scroll position when Room data is updated with new data from API.
  • Creative recycler view interactions / animations and pull-to-refresh.

Screenshots

Headlines with Technology tag

Headline Detail screen

Headlines Loading State

Pager loading next page

At offline and pager unable to load next page

Headlines with Health tag

accessibility text

news's People

Contributors

mayank-amr avatar

Watchers

 avatar

news's Issues

Not able to load data.

Tried to install the app. Getting this error : {"status":"error","code":"apiKeyInvalid","message":"Your API key is invalid or incorrect. Check your key, or go to https://newsapi.org to create a free API key."}
what is the reason behind it?

@Mayank-AMR

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.