This is a news app make purely in Kotlin and uses the Architecture Components, Dagger2 and RxJava
The app is built using dagger.android and RxJava. Below is the brief about the packages in the app:
di: This package contains all the files related to dependency injectioncomponent: It contains theAppComponentthat is responsible for generating all the code for injection and connecting the modules to injections.module: It contains the Modules that provide the dependencies needed by the app.qualifier: It contains theViewModelKey@MapKeyresponsible for the injection in theViewModel
base: It contains the base classes forActivityandViewModelmodel: Contains all the POJOsnews/list: Contains the activity, adapter and viewmodel for the news list.repository: Contains the repository for the app. This repository is responsible for loading data from server, caching it and providing it to the viewmodel.service: Interface that is used by reteofit for the API calls.
Found a bug? Just create an issue and once assigned, start working on it!
You feel that the app can be improved somehow? Maybe the architecture can be made more robust so that the app is testable? Feel free to fork it and create a Pull Request.
This app makes use of The Guardian - Open Platform to display the news. In order to access this API, you'll need an API Key. Follow these 6 steps to obtain your key:
- Go to open-platform.theguardian.com;
- Scroll down to find Register for a developer key and click on it;
- Fill the form with your name, email and product name (in our case "World Now") and accept the T&C;
- Check your email inbox, you should have received your key;
- Open your global
gradle.propertiesfile in a text editor. It can be found at:- Windows:
C:\Users\YOUR_USERNAME\.gradle\ - Linux:
/home/YOUR_USERNAME/.gradle - Mac:
/Users/YOUR_USERNAME/.gradle
- Windows:
- Add a field
Guardian_ApiKey="ENTER_YOUR_API_KEY_HERE"in this file then rebuild the project. ABuildConfigfile with be generated with a field calledApiKeybecause of this linebuildConfigField 'String', "ApiKey", Guardian_ApiKeythat is in the app module build.gradle(app) file;
- Create an issue or comment on an existing one. Wait until it is assigned to you.
- Add your name to the Contributors.MD file in format
## Name: Your name
## GitHub: [Your github id](url of the profile)
- Fork the repository and clone to your local machine
git clone https://github.com/your-username/World-Now.git
- Create a separate branch in format
issue-number
git checkout -b issue-number
For example, if you are working on issue-1
git checkout -b issue-1
- Commit and push
git add .
git commit -m "Commit Message"
git push origin branch-name
- Create a new pull request from your forked repository
- Wait for your PR to be merged and approved.
Made with 💙 in Kotlin
