Nyuzuk

所属分类:编程语言基础
开发工具:kotlin
文件大小:0KB
下载次数:0
上传日期:2019-09-10 17:02:54
上 传 者sh-1993
说明:  用Kotlin编写的Android应用程序,显示新闻文章,并展示Clean Architecture、MVVM+LiveData、Coroutines Flow、Ro...、...,
(Android app written in Kotlin that displays news articles and showcases the use of Clean Architecture, MVVM+LiveData, Coroutines Flow, Room and many more!)

文件列表:
.circleci/ (0, 2019-09-10)
.circleci/config.yml (1627, 2019-09-10)
LICENSE (11357, 2019-09-10)
build.gradle (1027, 2019-09-10)
buildsystem/ (0, 2019-09-10)
buildsystem/dependencies.gradle (6877, 2019-09-10)
buildsystem/test-reporting.gradle (616, 2019-09-10)
data/ (0, 2019-09-10)
data/build.gradle (2063, 2019-09-10)
data/proguard-rules.pro (751, 2019-09-10)
data/src/ (0, 2019-09-10)
data/src/androidTest/ (0, 2019-09-10)
data/src/androidTest/java/ (0, 2019-09-10)
data/src/androidTest/java/com/ (0, 2019-09-10)
data/src/androidTest/java/com/andres/ (0, 2019-09-10)
data/src/androidTest/java/com/andres/nyuzuk/ (0, 2019-09-10)
data/src/androidTest/java/com/andres/nyuzuk/data/ (0, 2019-09-10)
data/src/androidTest/java/com/andres/nyuzuk/data/ExampleInstrumentedTest.java (733, 2019-09-10)
data/src/main/ (0, 2019-09-10)
data/src/main/AndroidManifest.xml (114, 2019-09-10)
data/src/main/kotlin/ (0, 2019-09-10)
data/src/main/kotlin/com/ (0, 2019-09-10)
data/src/main/kotlin/com/andres/ (0, 2019-09-10)
data/src/main/kotlin/com/andres/nyuzuk/ (0, 2019-09-10)
data/src/main/kotlin/com/andres/nyuzuk/data/ (0, 2019-09-10)
data/src/main/kotlin/com/andres/nyuzuk/data/datasource/ (0, 2019-09-10)
data/src/main/kotlin/com/andres/nyuzuk/data/datasource/local/ (0, 2019-09-10)
data/src/main/kotlin/com/andres/nyuzuk/data/datasource/local/ArticleLocalDataSource.kt (632, 2019-09-10)
data/src/main/kotlin/com/andres/nyuzuk/data/datasource/local/database/ (0, 2019-09-10)
data/src/main/kotlin/com/andres/nyuzuk/data/datasource/local/database/ArticleDao.kt (844, 2019-09-10)
data/src/main/kotlin/com/andres/nyuzuk/data/datasource/local/database/ArticleDatabase.kt (1039, 2019-09-10)
data/src/main/kotlin/com/andres/nyuzuk/data/datasource/local/database/Converters.kt (1179, 2019-09-10)
data/src/main/kotlin/com/andres/nyuzuk/data/datasource/remote/ (0, 2019-09-10)
data/src/main/kotlin/com/andres/nyuzuk/data/datasource/remote/ArticleRemoteDataSource.kt (1634, 2019-09-10)
data/src/main/kotlin/com/andres/nyuzuk/data/datasource/remote/api/ (0, 2019-09-10)
data/src/main/kotlin/com/andres/nyuzuk/data/datasource/remote/api/ApiPaginator.kt (316, 2019-09-10)
data/src/main/kotlin/com/andres/nyuzuk/data/datasource/remote/api/ArticleApiService.kt (550, 2019-09-10)
... ...

![Logo](https://github.com/andreshj87/Nyuzuk/blob/master/logo.png) [![CircleCI](https://github.com/andreshj87/Nyuzuk/blob/master/https://circleci.com/gh/andreshj87/Nyuzuk.svg?style=svg)](https://github.com/andreshj87/Nyuzuk/blob/master/https://circleci.com/gh/andreshj87/Nyuzuk) [![Codacy Badge](https://github.com/andreshj87/Nyuzuk/blob/master/https://api.codacy.com/project/badge/Grade/4444fcaff2c847bf92757f839c138c46)](https://github.com/andreshj87/Nyuzuk/blob/master/https://app.codacy.com/app/andreshj87/Nyuzuk?utm_source=github.com&utm_medium=referral&utm_content=andreshj87/Nyuzuk&utm_campaign=Badge_Grade_Dashboard) [![Codacy Badge](https://github.com/andreshj87/Nyuzuk/blob/master/https://api.codacy.com/project/badge/Coverage/7e32dafe20574c42afc2ae4437278db0)](https://github.com/andreshj87/Nyuzuk/blob/master/https://www.codacy.com/app/andreshj87/Nyuzuk?utm_source=github.com&utm_medium=referral&utm_content=andreshj87/Nyuzuk&utm_campaign=Badge_Coverage) # Nyuzuk Android app written in Kotlin that displays news articles - powered by [News API](https://github.com/andreshj87/Nyuzuk/blob/master/https://newsapi.org) ## How to run it? In order to make it work, make sure to get your free API key from https://newsapi.org and add it to a new file `config/secrets.properties` like this: ```plain API_KEY=%your-api-key% ``` Do a gradle sync and everything should be ready. ## Architecture It's designed based in the classic 3-layer **clean architecture**. ![](https://github.com/andreshj87/Nyuzuk/blob/master/https://raw.githubusercontent.com/ImangazalievM/CleanArchitectureManifest/master/images/CleanArchitectureLayers.png) Every layer is represented as module, thus achieving separation of concerns. Also, it is important to note that domain layer is defined as a pure-kotlin non-android module, in order to avoid dependencies with the android framework. ### domain layer This is where all of our **domain entities** and **business logic** is. This layer does not need to know anything about the other 2, being totally independent in this sense. Other layers are responsible for mapping models to be naturally understood by the `domain` layer. Use cases contain business logic that can be used by the `presentation` layer, and make use of repositories that are implemented in the `data` layer. I'm using [coroutines](https://github.com/andreshj87/Nyuzuk/blob/master/https://kotlinlang.org/docs/reference/coroutines-overview.html) [flow](https://github.com/andreshj87/Nyuzuk/blob/master/https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-flow/) to be able to execute asynchronous code. ## data layer This is where our repository implementations and data sources are. Repositories are responsible for deciding whether to retrieve data from local or remote datasources. I'm using [Room](https://github.com/andreshj87/Nyuzuk/blob/master/https://developer.android.com/jetpack/androidx/releases/room) as database for the local datasource and Retrofit for the remote datasource. ## presentation layer In this layer I'm using the MVVM pattern, using [Jetpack ViewModels](https://github.com/andreshj87/Nyuzuk/blob/master/https://developer.android.com/topic/libraries/architecture/viewmodel) and exposing a [LiveData](https://github.com/andreshj87/Nyuzuk/blob/master/https://developer.android.com/topic/libraries/architecture/livedata) object that the view (activities or fragments) is observing and can react updating the UI accordingly. ## other I'm using [koin](https://github.com/andreshj87/Nyuzuk/blob/master/https://github.com/InsertKoinIO/koin) for dependency injection and, even if the learning curve is super smooth making it really easy to setup, you better watch out for any potential runtime crash while trying to resolve dependencies. It's worth mentioning that I'm using the `Either` class from [Λrrow](https://github.com/andreshj87/Nyuzuk/blob/master/https://github.com/arrow-kt/arrow) library, since it allows a very natural way of handling errors.

近期下载者

相关文件


收藏者