- MVVM Architectural pattern
- Kotlin
- Unit test demonstration using JUnit, Mockito and PowerMockito
- Static code analysis report using Sonarqube
- Gradle scripts for running sonarqube static code analysis, code coverage, etc.
- More than 80% coverage for business logic
The application has been designed using Android Architecture components and Data Binding
The whole application is built based on the MVVM architectural pattern.
The main advatage of using MVVM, there is no two way dependency between ViewModel and View unlike MVP. Here the view can observe the datachanges in the viewmodel as we are using LiveData which is lifecycle aware. The viewmodel to view communication is achieved through observer pattern (basically observing the state changes of the data in the viewmodel).
a) Android Architectural Components (LiveData, Lifecycle Aware components, ViewModel)
b) Dagger 2 for Dependency Injection
c) MVVM
d) Retrofit with Okhttp
e) JUnit and Mockito for Unit testing
f) Repository pattern for Data Layer
g) RxJava for Reactive programming pattern
Open terminal and type the below command to generate debug build
./gradlew assembleDebug
Open terminal and type the below command to generate release build
./gradlew assembleRelease
Open gradle.properties and update the below line with the sonarqube server url
systemProp.sonar.host.url=http://localhost:9000
Before running the sonarqube job, make sure the project version has been updated in the build.gradle. On every run, increment the version by 1.
property "sonar.sources", "src/main"
property "sonar.projectName", "NYTimesApp" // Name of your project
property "sonar.projectVersion", "1.0.0" // Version of your project
property "sonar.projectDescription", "NYTimes Application to list popular Articles"
For running the sonarqube job, type the below command in the terminal.
./gradlew sonarqube assembleDebug
Open terminal and type the following command
./gradlew clean jacocoTestReport
The coverage report will be generated on the following path.
app/build/reports
Open terminal and type the following command
./gradlew lint
The lint report will be generated on the following path.
app/build/reports