- Takes a world name.
- Stores it in local database.
- Display list of worlds stored on Device.
- The list refreshes on adding new worlds.
- Loads a cute image from the internet.
MVVM
with Clean architecture patternData Binding
with custom attributes such asxml app:imageUrl
Room
libraryHILT
Dependency Injection for loading objects such as Retrofit client, Database, Repositories, Viewmodels etcRetrofit
client that maps response to methods usingFlow
API.
The project started with simple Hello world. You can type the world name. You will see a list of worlds that are in DB.
The list is displayed using RecyclerView that is built with LiveData. Hence the list is always containing the latest data.
-
Activity
- ImageView that loads an image from the internet using custom attribute
app:imageUrl = "url" app:placeholder = "@{@drawable/...} app:error = "@{@drawable/..."
- EditText & a Button to save new world name in database
- RecyclerView displays list of worlds.
-
ViewModel
- Exposes Immutable data to Activity layout.
- Performs api calls with callbacks for each stage of an api call, that is:
onStart
,onCompleted
andonError
, and finallycollect via Flow
.
- Data models for Room and network request/response.
- Repositories to handle api/Room data and passes data back to viewmodels using
kotlin flows
.
- Room Database storing input world names.
- Using Retrofit with Moshi for network calls.
- Using Sandwich by Skydoves to further enhance api calls with much better error handling.
- ErrorResponseMapper to centeralise error handling.
- DataBinding
- Viewmodel data in layout
- Custom attributes with
@BindingAdapter
- BaseActivity, BaseViewmodel & BaseRepository.
- Utilities - CommonTheme, Image load, Dialogs.
- UI State & Use Case via domain layer.
- Compose UI.
- Test module.