Skip to content

Video-on-demand App using MVVM, Kotlin, Coroutine, Retrofit 2, RoomDB, Hilt, JUnit4, Espresso

License

Notifications You must be signed in to change notification settings

ryanw-mobile/video-player-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

9df1f2f · Apr 29, 2024
Apr 25, 2024
Apr 22, 2024
Apr 29, 2024
Apr 29, 2024
Apr 22, 2024
Apr 28, 2024
Dec 23, 2023
Apr 22, 2024
Apr 25, 2024
Apr 29, 2024
Apr 22, 2024
Apr 22, 2024
Apr 24, 2024
Apr 24, 2024
Dec 22, 2023
Apr 21, 2024

Repository files navigation

DAZN Code Challenge - Android TV Gradle Build codecov

A responsive Android sample app written in Kotlin and Jetpack Compose, supporting different navigation layout on screen sizes. The video player is currently Jetpack Media 3.

The events under the Events tab provides video playback. The schedule under the Schedule tab refreshes automatically every 30 seconds. For both tabs, you can always do swipe-to-refresh, or tap the navigation icon to scroll to the top of the list.

History

This was a code test assignment as a part of the interview process. The task covered common RESTApi, SQLite, RecyclerView, Constraint Layout, MVVM, plus dependency injection and testings.

Although the title carries "Android TV", it has nothing to do with that - this is an Android mobile App as required by the specifications.

The interview process was concluded in October, 2021, but I am still keep on improving the codes for demonstration purpose.

The original XML View version is no longer maintained, you can access to the XML branch here.

Please note that the APIs are supplied by DAZN in 2021 for recruitment purpose. They may not work at any time.

Screenshots

 

To-do lists

Planned enhancements are now logged as issues.

High level architecture

  • Kotlin
  • MVVM & clean architecture
  • Jetpack Compose - Single Activity
  • Kotlin Coroutines and Flow
  • Dependency Injection using Dagger Hilt
  • Material 3
  • Dynamic screen layout support using Windows Size Class
  • Jetpack Media 3 video player
  • Gradle Kotlin DSL and Version Catalog
  • Baseline Profile
  • Full unit test and UI (Journey) test suite

Major libraries used

Binaries download

If you want to try out the app without building it, check out the Releases section where you can find the APK and App Bundles for each major version.

Requirements

  • Android Studio Iguana | 2023.2.1
  • Android device or simulator running Android 9.0+ (API 28)

Building the App

Setting up the keystore

Release builds will be signed if either the keystore file or environment variables are set. Otherwise, the app will be built unsigned.

Local

  • Android Keystore is not being stored in this repository. You need your own Keystore to generate the apk / App Bundle

  • If your project folder is at /app/dazn-code-challenge/, the Keystore file and keystore.properties should be placed at /app/

  • The format of keystore.properties is:

       store=/app/release-key.keystore
       alias=<alias>
       pass=<alias password>
       storePass=<keystore password>
    

CI environment

  • This project has been configured to support automated CI builds.

  • The following environment variables have been set to provide the keystore:

       CI = true
       HOME = <the home directory of the bitrise environment>
       CI_ANDROID_KEYSTORE_PASSWORD = <your keystore password>
       CI_ANDROID_KEYSTORE_ALIAS = <your keystore alias>
       CI_ANDROID_KEYSTORE_PRIVATE_KEY_PASSWORD = <your keystore private key password>
    

Build and install on the connected device

This app has two build variants: Debug and Release. The most common build commands are:

  • ./gradlew clean installDebug
  • ./gradlew clean instal
  • ./gradlew clean bundleRelease
  • ./gradlew clean assembleRelease

The generated apk(s) will be stored under app/build/outputs/ Debug builds will have an App package name suffix .debug