Skip to content

A sample Android app built with Kotlin and Compose, using the Jetpack Architecture components to view YouTube Channels and their associated Playlists and Videos.

License

Notifications You must be signed in to change notification settings

akoscz/YouTubeChannels

Repository files navigation

YouTube Channels App

This is an Android application I am building to learn and practice Kotlin and Jetpack Compose. It allows users to search for YouTube channels, explore their details, and discover playlists and videos. The app leverages Jetpack Architecture components and the Model-View-ViewModel (MVVM) architecture to separate concerns, enhance testability, and improve code maintainability. The Paging library is used to handle large datasets and load content seamlessly.

The app utilizes Retrofit for network operations, enabling seamless communication with the YouTube Data API. Retrofit simplifies HTTP requests and responses, making it easy to fetch and parse data from the API.

For local data storage and caching, I am using Room, a robust SQLite database management library. Room provides an abstraction layer over SQLite, allowing for efficient data management and offline support by persisting data locally on the device.

Dependency injection in the app is managed with Hilt, which streamlines the process of providing dependencies throughout the application's lifecycle. Hilt reduces boilerplate code and improves the maintainability and scalability of the application by injecting dependencies where needed.

Table of Contents

Features

  • Search for channels by name
  • Follow channels you are interested in
  • View channel details, including subscriber count and recent videos
  • Simple user interface similar to the YouTube app
  • Utilizes Android Jetpack libraries for enhanced performance and efficiency
  • Bundled mock data to try out the app without an API key

Prerequisites

To build and run this application, you'll need the following:

  • Git: For version control and cloning the repository. Download Git
  • Android Studio (Latest Version): The official IDE for Android development. Download Android Studio
  • Java Development Kit (JDK) version 1.8 or higher: Required for building Android apps with Kotlin.
  • YouTube Data API v3 API Key: This key is essential to access YouTube data. You can obtain it from the Google Cloud Platform (GCP) Console after enabling the YouTube Data API v3. This API allows your app to interact with YouTube's library of videos, channels, and playlists.
  • local.properties Add the API key to your local.properties file. api_key=YOUR_API_KEY

Installation

To clone and run this application, you'll need Git and the latest version of Android Studio installed on your computer. Follow these steps:

  1. Clone the repository:

    git clone https://github.com/akoscz/YouTubeChannels.git
  2. Open the project in Android Studio:

    • Open Android Studio.
    • Select File > Open.
    • Navigate to the directory where you cloned the repository and select it.
  3. Build and run the app:

    • Make sure you have the latest Android SDK and build tools installed.
    • Build the app using the "Build" menu.
    • Run the app on your Android device or emulator.

Libraries

The project uses several key libraries and plugins:

Core UI and Development

Navigation and State Management

Data Handling

Testing

Plugins

  • Android Application Plugin: com.android.application:8.5.1
    Provides essential tools for building Android apps, including APK generation and code obfuscation.

  • Kotlin Android Plugin: org.jetbrains.kotlin.android:1.9.24
    Enables Kotlin support for Android projects, allowing you to write Android apps using Kotlin language features.

  • Hilt Plugin: com.google.dagger.hilt.android:2.51.1
    Integrates Hilt's dependency injection framework into Android projects, simplifying Dagger setup.

  • Room Plugin: androidx.room:2.6.1
    Provides support for generating Room database code, facilitating database schema management and migrations.

Ensure your local.properties file includes the necessary configuration for api_key key.

Usage

  1. Open the app on your Android device.
  2. Navigate to the Search tab.
  3. Use the search bar to find channels by name.
  4. Browse through the list of matched YouTube channels.
  5. Follow channels your interested in.
  6. Navigate to the Following tab.
  7. Tap on a channel to view more details and recent uploads.

Contributing

Contributions are welcome! If you'd like to contribute, please fork the repository and use a feature branch. Pull requests are warmly welcome.

  1. Fork this repository.
  2. Create a new branch: git checkout -b my-feature-branch.
  3. Make your changes and commit them: git commit -m 'Add some feature'.
  4. Push to the branch: git push origin my-feature-branch.
  5. Submit a pull request.

License

This project is licensed under the Apache 2.0 License - see the LICENSE file for details.

About

A sample Android app built with Kotlin and Compose, using the Jetpack Architecture components to view YouTube Channels and their associated Playlists and Videos.

Resources

License

Stars

Watchers

Forks

Languages