• Stars
    star
    846
  • Rank 53,868 (Top 2 %)
  • Language
    Kotlin
  • License
    MIT License
  • Created over 7 years ago
  • Updated about 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A sample News πŸ—ž app built using Modern Android Development [Architecture Components, Coroutines, Retrofit, Room, Kotlin, Dagger]

News App πŸ—ž

GitHub license

News App is a simple news app πŸ—žοΈ which uses NewsAPI to fetch top news headlines from the API. The main aim of this app is to be a leading example of how to build Modern Android applications for all Android Developers

The codebase focuses πŸ‘“ on following key things:

  • Code structuring, style and comments
  • Dependency injection πŸ—‘
  • Offline first ✈️
  • Kotlin + Coroutines
  • And tests πŸ› 
  • Emojis (ofcourse) πŸ˜›

The idea is to keep the app super simple while demonstrating new libraries and tools which makes it easier to build high quality Android applications.

NewsApp Main Page

Development Setup πŸ–₯

You will require latest version of Android Studio 3.0 (or newer) to be able to build the app

API key πŸ”‘

You'll need to provide API key to fetch the news from the News Service (API). Currently the news is fetched from NewsAPI

  • Generate an API key (It's only 2 steps!) from NewsAPI
  • Create new file named -> credentials.properties in our project root folder
  • Add the API key as shown below [Make sure to keep the double quotes]:
    NEWS_API_KEY = "<INSERT_YOUR_API_KEY>"
  • Build the app
  • Enjoyyyyy πŸŽ‰

Libraries and tools πŸ› 

News App uses libraries and tools used to build Modern Android application, mainly part of Android Jetpack πŸš€

Architecture

The app uses MVVM [Model-View-ViewModel] architecture to have a unidirectional flow of data, separation of concern, testability, and a lot more.

Read more:

Architecture

Dependency Graph πŸ”ͺ

The following diagram shows the dependency graph of the app.

News App Dependency Graph

Generated by Daggraph


Learn Architecture Components

Trying to learn the new Architecture Components. I have wrote a series of articles to understand Android Architecture Components. Feel free to check it out to learn more.

Extra - Caster.io Course and Podcast

Testing

The architecture components are highly testable. Following table shows how to test various parts of the app (cheatsheet for testing architecture component)

Component Test Mock
UI Espresso ViewModel
ViewModel JUnit Repository
Repository JUnit DAO and WebService
DAO Instrumented -
WebService Instrumented MockWebServer

Contributing

Please read CONTRIBUTING.md for contributions.

License

The MIT License (MIT)

Copyright (c) 2017 Akshay Chordiya

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

More Repositories

1

NewsAppMVI

News app πŸ—žοΈ showcasing MVI architecture combined with Architecture Components
Kotlin
42
star
2

gofun-android

Motivates you to go home 🏑 and live your life
Kotlin
23
star
3

LifecycleMusicPlayer

Sample music player app with lifecycle component to play/pause music when certain lifecycle events are triggered in Activity
Kotlin
21
star
4

NewsViewModelDemo

Simple RecyclerView demo app using ViewModel component to survive configuration change with a list of news
Kotlin
12
star
5

kotlinx.coroutines-rx1

Support for Kotlin Coroutines + Flow with RxJava 1
Kotlin
11
star
6

SensorLiveData

Sample app which uses proximity sensor and listens to changes in it' value, in a lifecycle-aware fashion by extending LiveData
Kotlin
8
star
7

GoHome

Reminds you to close the work and go home after completion of working hours
Go
8
star
8

gofun-desktop

Motivates you to go home 🏑 and live your life
Go
7
star
9

ActiveNotify

Get instant access to Notifications & Time
Java
7
star
10

news-app-fragments

Simple News Android app written in 100% Kotlin for demo at Fragments Conference
Kotlin
7
star
11

AndroidViewModelDemo

Simple app which shows list of "Saved WiFi networks" using AndroidViewModel component to survive configuration change.
Kotlin
6
star
12

MVVMNewsAppTemplate

Super Simple MVVM News App Template with Architecture Components
Kotlin
4
star
13

GoFoodie

Foodie tool to suggest yummy πŸ˜‹ stuff to cook 🍳
Go
4
star
14

Algorithm

My First App
4
star
15

LiveDataTransformations

Sample app which shows Pokemons' and demonstrates usage of LiveData transformations
Kotlin
4
star
16

timer-kotlin-sample

Simple Count down timer application made in Kotlin for demonstration
Kotlin
3
star
17

MusicTrimmer

Trims the unwanted data from song
Python
3
star
18

aye-captain

Aye captain βš“οΈ is a tool for generating release notes from Jira tickets
Kotlin
3
star
19

LifecycleAwareLoggingDemo

Simple demo of lifecycle component to log when certain lifecycle events are triggered in Activity
Kotlin
2
star
20

SectionedRecyclerView

Inbox style Section Recycler View
Java
2
star
21

WorkTimeout

Reminds you to close the work on completion of working hours
Batchfile
2
star
22

CounterViewModelDemo

Simple counter app demo using ViewModel component to survive configuration change
Kotlin
2
star
23

AutomatonUnlock

Help me to translate the app into your language
2
star
24

Intelligabble

Intelligabble is a Kotlin Multiplatform App which explains tech related terms like Git, VCS, branch, API, executable file, etc in an easy and user-friendly format to non-tech people like designers, product owners in an agile team
Kotlin
2
star
25

MA-Practical

All the Latex and codes related to Mobile Application Practical
TeX
1
star
26

OSSRH-57828

1
star
27

mad-meetup-kotlin-sample

Sample Kotlin app made for Mad Meetup March'18
Kotlin
1
star
28

freshersbatch-oct16

Java
1
star
29

EmergencyCall

Android application to call or message emergency number.
Java
1
star
30

assignment-namer

A simple utility to add names in the assignments
Java
1
star
31

FontsSample

Sample application showcasing usage of fonts with Android Support Library
Kotlin
1
star
32

Pronouncer

HTML
1
star
33

BinarySearch

Custom code for binary search using ternary operator
Java
1
star
34

andless

Automatically exported from code.google.com/p/andless
1
star
35

sectionrecyclerview-sample

Sample of using Sections in RecyclerView
Java
1
star
36

Unification

Unification is the process of solving equations between symbolic expressions.Mainly used in Artificial Intelligence
Python
1
star