A simple news app allows searhcing for news given a search term.
To be able to build this app locally, you need to have API key from newsapi.org. To include the API key in the project follow the steps:
- Go to newsapi.org.
- Click Get API Key
- Register a free/developer account to obtain the API key.
- Copy the provided API key.
- In app root directly, open
local.properties
file. If it's not there, create one. - Paste the provided API key into the file in the following form:
newsApiKey="xxxxxxxxxxxxxx"
- Now you should be able to build and run the app normally.
App follows Google's recommended app architecture, which consists mainly of the following layers:
- UI. Single Activity with multiple Fragments
- Presentation. ViewModel/LiveData
- Repository to abstruct data sources.
- Remote. Unofficial Java News client
Paging 3 in conjunction with Rxjava 2.x was used to handle the news pagination.
Android Navigation Component was used to handle navigation between different screens and pass data between screens.
Dependencies are bing injected manually which works fine for now.
JUint 4, mockito-kotlin along side some android core testing libraries were used for unit tests.