Native Kotlin
For Gradle, i am using the Kotlin DSL, so the extension of the build.gradle file, which was previously in Groovy, will be changed to build.gradle.kts, as shown in the following image.
Please used JAVA Version using VERSION_17:
android {
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
}
Android Gradle Plugin Version 8.0.1 and Gradle Version 8.0
plugins {
id("com.android.application") version "8.0.1" apply false
id ("com.android.library") version "8.0.1" apply false
id ("org.jetbrains.kotlin.android") version "1.8.20" apply false
id ("com.google.dagger.hilt.android") version "2.44" apply false
}
The architecture of this project, I am using Clean Architecture combined with Model View ViewModel (MVVM), which acts as the presentation layer.
Here is the implemented flow diagram for this project:
Here is the project structure that I have implemented using Clean Architecture.
The API used in this project is https://app.goapi.id or https://goapi.id/.
The base URL used is as follows:
https://api.goapi.id/v1/
Method | Endpoint | Usage |
---|---|---|
GET | regional/provinsi?api_key{API_KEY} or regional/provinsi?api_key=Mz4GqJZQbtqFh7o3UVTaEvUQ3qpX7q |
Get All Province |
I am using several third-party libraries for this project, such as libraries for Dependency Injection, RestAPI, Reactive Programming, Unit Testing, etc.
Name | Library |
---|---|
Dagger Hilt | com.google.dagger:hilt-android:2.44 |
Dagger Hilt Compiler | com.google.dagger:hilt-android-compiler:2.44 |
AndroidX Hilt Compiler | androidx.hilt:hilt-compiler:1.0.0 |
Name | Library |
---|---|
RxAndroid | io.reactivex.rxjava3:rxandroid:3.0.0 |
RxRava | io.reactivex.rxjava3:rxjava:3.0.7 |
RxBinding | com.jakewharton.rxbinding3:rxbinding:3.0.0 |
Name | Library |
---|---|
Retrofit2 | com.squareup.retrofit2:retrofit:2.9.0 |
Retrofit2 RxJava | com.squareup.retrofit2:adapter-rxjava3:2.9.0 |
Retrofit2 Gson | com.squareup.retrofit2:converter-gson:2.9.0 |
Name | Library |
---|---|
OkHttp | com.squareup.okhttp3:okhttp:4.9.0 |
OkHttp Interceptor | com.squareup.okhttp3:logging-interceptor:5.0.0-alpha.3 |
Chucker Debug | com.github.chuckerteam.chucker:library:3.5.2 |
Chucker Release | com.github.chuckerteam.chucker:library-no-op:3.5.2 |
Name | Library |
---|---|
Junit4 | junit:junit:4.13.2 |
Mockito | org.mockito:mockito-core:4.0.0 |
Here are the results of the conducted unit tests
created by [wahyouwebid](http://github.com/wahyouwebid)
You can contact me at : wahyouwebid@gmail.com