Skip to content

mfandcc/video-player-app

 
 

Repository files navigation

Video Player App
Gradle Build Codacy Coverage Badge Codacy Quality Badge Renovate enabled

Warning

I do not support the use of my code for your job applications, as it creates unfair competition. If you copy or fork this for that purpose, you risk disqualification. Please respect the integrity of the process and create your own work.

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.

 

History

This was a code test assignment done in October, 2021, but I am still keep on improving the codes for demonstration purpose.. The task covered common RESTApi, SQLite, RecyclerView, Constraint Layout, MVVM, plus dependency injection and testings.

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. They may not work at any time. There is a plan to replace them with my own APIs and contents.

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

Dependencies

Plugins

Building the App

Without Keystore (Debug Builds)

By default, debug builds do not require a keystore. You can run:

./gradlew assembleDebug

No signing config is required unless you explicitly build a release variant.

With Keystore (Release Builds)

Signing configuration is only triggered when:

  • the task includes "Release" or "Bundle"
  • or the environment variable CI=true is set

There are two ways to supply the keystore:

1. Environment Variables (For CI)

Provide the following environment variables (e.g. in GitHub Secrets):

KEYSTORE_LOCATION=./keystore.jks
CI_ANDROID_KEYSTORE_ALIAS=yourAlias
CI_ANDROID_KEYSTORE_PASSWORD=yourKeystorePassword
CI_ANDROID_KEYSTORE_PRIVATE_KEY_PASSWORD=yourPrivateKeyPassword

2. keystore.properties File (For Local Builds)

Create a keystore.properties file at the root:

alias=yourAlias
pass=yourPrivateKeyPassword
store=path/to/keystore.jks
storePass=yourKeystorePassword

Then build:

./gradlew bundleRelease

Output Format

Release builds are timestamped using the format:

<app-name>-<buildType>-<versionName>-<yyyyMMdd-HHmmss>.apk

This applies to both APK and AAB artifacts.

Workflow Overview

The .github/workflows/tag_create_release.yml file defines the CI/CD pipeline. It performs the following:

  1. Checks out the code.
  2. Sets up JDK 17.
  3. Builds the APK and AAB using Gradle.
  4. Creates a GitHub Release.
  5. Uploads the outputs as release assets.

Trigger the workflow by tagging a commit with the format: release/*, e.g. release/1.2.3.

Usage

To trigger the CI pipeline:

git tag release/1.0.0
git push origin release/1.0.0

GitHub Actions will build the release and publish it with assets.

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Kotlin 100.0%