Skip to content

A jetpack compose app for calling and retrieving the Api.

Notifications You must be signed in to change notification settings

Gianguyen1234/Amphibians

Repository files navigation

Amphibians


About App

  • This is one of my android app project. I'm practicing calling Api in jetpack compose.
  • I used the UDF( undirectional data flow) design pattern to design the app.
  • I created UI layer for exposing data on the screen and Data layer for managing the data.
  • To calling or fetching Api you need these features below:
    • Retrofit for network
    • Gson/Json converter factory for tranfering kotlin data object.
    • kotlin.serialization for parsing JSON file
    • Coil for loading images
  • I also created a unit test for ViewModel and Repository.
  • Undirectional data flow:

    state-unidirectional-flow

  • UI layer: mad-arch-ui-udf-in-action

  • Data layer: f13e3d6207f3ecf1_1440

  • Demo app: https://youtube.com/shorts/NE7sC3vIPtc
  • In consclusion: to all api you to set up a UI layer and a Data layer:
    • The UI layer contains ViewModel and UiState (Composable function). The ViewModel is in charge of exposing the screen UI state, and handling the business logic in the UI layer and calling the business logic from other layers of the hierarchy.
    • The Data layer is responsile for retrieving the data from the api. The data layer includes: data class, repository for managing the data and data source class to retrieve the data from the network.
    • You should use Dependency Injection (DI) to keep your app flexible, robust, and ready to scale.

About

A jetpack compose app for calling and retrieving the Api.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages