|
| 1 | +# StreamGate Android App Project |
| 2 | + |
| 3 | +StreamGate is an open-source native Android application designed as a technical showcase for capturing, processing, and uploading video content directly to the cloud. Built purely for developers, it demonstrates how to handle complex mobile media workflows—such as local video selection, camera capture, background screen recording, and reliable direct-to-cloud resumable uploads using FastPix infrastructure. |
| 4 | + |
| 5 | +Once an upload completes, StreamGate generates an instant, shareable playback link. |
| 6 | + |
| 7 | +--- |
| 8 | + |
| 9 | +## Core Features & Architecture |
| 10 | + |
| 11 | +StreamGate is built using a modern Android tech stack (100% Kotlin, Jetpack Compose, Dagger Hilt) and focuses on the following core capabilities: |
| 12 | + |
| 13 | +1. **Camera Capture**: Integrates `CameraX` (`camera-camera2`, `camera-video`, etc.) for robust, native video recording directly within the app. |
| 14 | +2. **Screen Recording**: Uses Android's `MediaProjection` API combined with Foreground Services to capture device-wide screen activity reliably. |
| 15 | +3. **Gallery Picker**: Implements native Android intent workflows to browse and select existing local video files. |
| 16 | +4. **Direct Cloud Uploading**: Utilizes the FastPix Resumable Uploads SDK to push large media files securely to the cloud without needing to route them through an intermediary backend server. |
| 17 | +5. **Local Playback/Preview**: Integrates the FastPix Android Player SDK (`io.fastpix.player:android`) to preview the selected or recorded video locally before generating the final shareable link. |
| 18 | + |
| 19 | +--- |
| 20 | + |
| 21 | +## Tech Stack & Dependencies |
| 22 | + |
| 23 | +* **Language**: Kotlin |
| 24 | +* **UI Framework**: Jetpack Compose (Material 3, `activity-compose`) |
| 25 | +* **Dependency Injection**: Dagger Hilt (`hilt-android`, `hilt-navigation-compose`) |
| 26 | +* **Camera**: CameraX (`camera-camera2`, `camera-video`, `camera-view`, `camera-lifecycle`, `camera-extensions`) |
| 27 | +* **Networking**: Retrofit with Kotlinx Serialization (`converter-kotlinx-serialization`) |
| 28 | +* **Media Loading**: Coil (`coil-compose`) |
| 29 | +* **Local Storage**: Jetpack DataStore (`datastore-preferences`) |
| 30 | +* **Build Constraints**: `minSdk = 24`, `targetSdk = 37`, `compileSdk = 37`, Java 11 |
| 31 | + |
| 32 | +--- |
| 33 | + |
| 34 | +## Setup & Build Instructions |
| 35 | + |
| 36 | +Because StreamGate relies on FastPix's private GitHub Package Registry for its SDKs, and requires specific API keys to initialize uploads, you must configure your local environment before building. |
| 37 | + |
| 38 | +### 1. Prerequisites |
| 39 | +You will need: |
| 40 | +* A **FastPix Account** (to retrieve your API Token ID and Secret Key). |
| 41 | +* A **GitHub Personal Access Token (PAT)** with `read:packages` permissions. FastPix SDKs are hosted on GitHub Packages (`maven.pkg.github.com/FastPix/android-uploads-sdk`), and Gradle requires this token to download them. |
| 42 | + |
| 43 | +### 2. Configure `local.properties` |
| 44 | +Clone the repository and open the project in Android Studio. Before syncing Gradle, create or open the `local.properties` file in the root directory and add the following credentials: |
| 45 | + |
| 46 | +```properties |
| 47 | +# FastPix API Credentials |
| 48 | +fastpix.tokenId=YOUR_FASTPIX_TOKEN_ID |
| 49 | +fastpix.secretKey=YOUR_FASTPIX_SECRET_KEY |
| 50 | + |
| 51 | +# GitHub Credentials for Maven package resolution |
| 52 | +github.username=YOUR_GITHUB_USERNAME |
| 53 | +github.token=YOUR_GITHUB_PERSONAL_ACCESS_TOKEN |
| 54 | +``` |
| 55 | + |
| 56 | +*Note: The FastPix keys are injected into the app at compile-time via `buildConfigField` as `BuildConfig.FASTPIX_TOKEN_ID` and `BuildConfig.FASTPIX_SECRET_KEY`. Never commit this file to version control.* |
| 57 | + |
| 58 | +### 3. Build & Run (Command Line) |
| 59 | +If you prefer building from the terminal, use the following Gradle wrapper commands: |
| 60 | + |
| 61 | +```bash |
| 62 | +# Clone the repository |
| 63 | +git clone https://github.com/your-username/StreamGate.git |
| 64 | +cd StreamGate |
| 65 | + |
| 66 | +# Ensure local.properties is set up as detailed above, then clean the project |
| 67 | +./gradlew clean |
| 68 | + |
| 69 | +# Build the debug APK |
| 70 | +./gradlew assembleDebug |
| 71 | + |
| 72 | +# Install on a connected emulator or physical device |
| 73 | +./gradlew installDebug |
| 74 | +``` |
| 75 | + |
| 76 | +Alternatively, just hit **"Run"** in Android Studio once the Gradle sync successfully resolves the FastPix dependencies. |
| 77 | + |
| 78 | +--- |
| 79 | + |
| 80 | +## Important Reference Links |
| 81 | + |
| 82 | +* FastPix Platform: [fastpix.com](https://fastpix.com/) |
| 83 | +* FastPix Access Token Guide: [Activate Your Account](https://fastpix.com/docs/getting-started/activate-your-account) |
| 84 | +* FastPix VOD Upload API Docs: [Direct Upload Video Media](https://fastpix.com/docs/video-on-demand-api/upload-and-import-videos/direct-upload-video-media) |
| 85 | +* FastPix Uploads SDK Repo: [android-uploads-sdk](https://github.com/FastPix/android-uploads-sdk) |
| 86 | +* FastPix Player SDK Repo: [fastpix-android-player](https://github.com/FastPix/fastpix-android-player) |
| 87 | + |
| 88 | +## License |
| 89 | +StreamGate is licensed under the MIT License. |
0 commit comments