Skip to content

[Active] DAZN Code Challenge. A take-home code project for the interview process. Using MVVM, Kotlin, Coroutine, Retrofit 2, RoomDB, Hilt, JUnit4, Espresso

License

Notifications You must be signed in to change notification settings

ryanw-mobile/dazn-code-challenge

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 Media 3 Exoplayer is implemented on top of the single activity architecture. It is fully functional with Picture-in-Picture support.

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.

Download the App

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 release.

Known issues

The video player has known refused-to-fix bugs on Android 14 and 15. You may see the video playback not resizing properly. As a workaround, rotating the device, toggling between full screen or Picture-in-Picture mode can solve the issue.

 

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

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

About

[Active] DAZN Code Challenge. A take-home code project for the interview process. Using MVVM, Kotlin, Coroutine, Retrofit 2, RoomDB, Hilt, JUnit4, Espresso

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

Languages