In this repository I tried to create an Android project using Advanced technologies like MVVM design pattern, Kotlin (Koin, Coroutine, Flows) etc. The purpose of creating this repository to use in technical test / interview and personal usage for the best Android app development practice.
- News list: User can read the latest news based on their location.
- Search News: User can search news according to the keyword where user can see the latest headlines.
- Save Favorite News: User can save the interesting news in the favorite section.
- From the drawer menu user can read news according to the category.
I tried to build this application following these terms. which are:
- performance
- readability
- maintainability
- testability
- scalability
- simplicity
The tools I have used to gain the Android Clean Architecture are:
-
MVVM : MVVM architecure is followed for the code boilerplate. Where View, ViewModel, Repisitory are clearly used for maintailed the SOLID principle. (https://www.geeksforgeeks.org/mvvm-model-view-viewmodel-architecture-pattern-in-android/)
-
Kotlin (https://kotlinlang.org/)
-
Coroutine : To reduce the main thread task we can divide the task in many thread asychronously using the Kotlin Coroutine using lifecycle scope. (https://developer.android.com/kotlin/coroutines)
-
Koin : KOIN is a ligh weight dependency injection which is written in pure Kotlin. Its really easy to learn and there is no generated code will be in KOIN used Android project. (https://insert-koin.io/)
-
Navigation : Nav graph used for using multiple fragment in a single activities. In this project MainActivity contains multiple fragment like SearchNewsFragment, NewsFragment etc.
-
Kotlin Flow : In coroutines, a flow is a type that can emit multiple values sequentially, as opposed to suspend functions that return only a single value. (https://developer.android.com/kotlin/flow)
-
Retrofit : (https://square.github.io/retrofit/)
For unit test I used Junit, where I tried two ways plain Unit test and Android instrumented unit test. For saving favorite news I used instrumented unit test for following test which Empty list check, Saved favorite list size test, news item already saved or not. Here is the test case result:
For this repository I have used a public news api. News Data: structured, relevant, real-time Search multi-language worldwide news articles published online with NewsCatcher's News API. Here is the link: https://newscatcherapi.com/