Skip to content

carlosolimpio/cstv-app

Repository files navigation

CSTV App

The CSTV app show a list with the running and upcoming CS2 matches. It allows you to see the match details like players and scheduled time.

Architecture

The architecture of the app follows the best practices and recommended architecture for modern app development from the android developer guide.

The overall architecture looks as shown on the image below:

The app has three main well-defined layers, implementing the MVVM architecture pattern, is separated into packages where each package contains a child feature package with each feature's components. The feature packages are mainlist and matchdetails.

  • Presentation:
    • The Presentation layer, also known as UI layer, is responsible for displaying the application data on the screen and also serve as the primary entry point for user interaction.
    • Inside the Presentation layer the app has the MainActivity which shows the Splash Screen and adds the Fragments for each feature/screen in the app.
    • In this layer the app has the Activities, Fragments and its ViewModels and Adapters for the lists used.
  • Data:
    • The Data layer connects to the Panda Score API pointing to CS:GO endpoints.
    • Inside the Data layer the app has the implementation of the domain's repository contract to fetch the data. In this example data is fetched from the api which is accessed using the Retrofit library under the remote package. Finally there is a mapper which is responsible for mapping the response we get from the API, here the app uses a DTO and Entity types of classes to convert between remote and domain models in order for the domain models to not have any dependency to the remote implementation selected.
  • Domain:
    • The domain Layer contains some core classes that are used on the App.
    • There is the DataResponse used to pass the data response from data layer to presentation layer whereas Success is used after the execution returned successfully and Error is used when an error occurred during execution.
    • Each feature has a package following the app architecture with its model and its repository's contract.

Overall this architecture is very robust, follows the official android developer guideline and makes it easy to maintain and scale the application.

Unit Tests

For unit testing there is a unit test for each feature view model (MainListViewModelTest and MatchDetailsViewModelTest) which is where the business logic of the application is.

Instruction to build the project

This is a standard Android application. To run the project you will need to follow the steps:

  • Import the project into Android Studio
  • Create a local.properties file under app project folder
    • Inside the new file add the line: pandascore_token="you panda score api token string here"
  • Build and Run the project

Demo

Watch the demo video on Google Drive

drawing drawing

Libraries used

The project was developed using some of the Android Jetpack Libraries and some third-party libraries as well.

Android Jetpack Libraries

  • View Binding: Feature that allows to write code that interacts with views, replacing the findViewById. For more details see the official docs.
  • Paging3: The Paging Library makes it easier for you to load data gradually and gracefully within your app's RecyclerView. See the official page.
  • SwipeRefreshLayout: A widget to implement the swipe to refresh UI-pattern. Docs.

Kotlin library:

Dependency Injection

  • Hilt: dependency injection library for Android that reduces the boilerplate of doing manual dependency injection in the project. For more details see the Dependency injection with Hilt

Third-party libraries:

Testing libraries:

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages