Skip to content

A simple Android app consuming Cats API and showing data in UI using Jetpack Compose. The project follows SOLID principles.

Notifications You must be signed in to change notification settings

rizwansworld/CatsApplication

Repository files navigation

App Screenshots:

Screenshot 2024-07-23 at 14 21 24 Screenshot 2024-07-23 at 14 21 55

Decisions:

  • Persistence of favorite cat id to Room database on clicking Heart Icon.
  • Each item in LazyColumn is independently observing the favorites database through LiveData in FavoritesViewModel

Architecture:

Dependency Inversion:

  • The Repository class has three dependencies injected.
  • Each dependency can be mocked separately and the repository can be tested for appropriate behaviour.
  • This helps us follow Dependency Inversion part of SOLID principle.

Open Closed Principle:

  • ApiMapper is an interface that can implemented to customize for each feature API call.
  • This was done to follow Open Closed Principle.
  • The ApiMapper interface will have reserved implementation of converting Input datatype to Output datatype.
  • At the same time, the extended class will have the open flexibility of providing how the Input and Output datatype will be converted.

About

A simple Android app consuming Cats API and showing data in UI using Jetpack Compose. The project follows SOLID principles.

Topics

Resources

Stars

Watchers

Forks

Languages