GithubHelp home page GithubHelp logo

nixaero / android_hilt_compose_newsapp Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 1.19 MB

News App: displays latest US/France news via NewsAPI.org. Built with Jetpack Compose & follows Clean Architecture MVVM.

Home Page: https://nereek.io/mobile-dev

Kotlin 98.47% Ruby 1.53%
android api-news chuck-interceptor coil courotines flow hilt-android jetpack-compose kotlin moshi

android_hilt_compose_newsapp's Introduction

Logo

News App Compose

News App Compose is a simple Android application that displays the latest news from the United States and France using the NewsAPI.org API.

This project serves as an introduction and demonstration of Clean Architecture and Jetpack Compose for building modern Android applications.

Architecture

The project adheres to the principles of clean architecture and is composed of several layers.

The main layers of the project include:

  • Presentation Layer: This layer is responsible for managing the user interface of the application. It includes components such as views, controllers, and presenters.

  • Domain Layer: This layer contains the business logic of the application. It defines the rules and operations that govern the behavior of the system. This layer should be independent of any specific technology or framework.

  • Data Layer: This layer is responsible for managing the data sources used by the application. It includes components such as repositories, data mappers, and data access objects.

In addition, the project includes a DI (Dependency Injection) layer that provides dependency injection for the different layers of the application. This helps to keep the code modular and maintainable by allowing each layer to be developed and tested independently.

Finally, the project also includes a Common layer that contains shared classes and methods used by multiple layers of the application. This helps to reduce code duplication and improve consistency across the project.

App structure

The mob.nereek.compose follows a well-organized architecture to facilitate the development and maintenance of Android applications, with the aim of creating flexible and long-term maintainable software applications.

Adding API token to the project

To add the API key, you need to replace API_NEWS_TOKEN with your actual News API key in the Constants.kt file.

object Constants {
    ...
    const val API_NEWS_TOKEN = "\"your_api_key_here\""
    ...
}

You can get your API key by signing up for News API on their website: https://newsapi.org/register

Libraries Used

Several third-party libraries were used to facilitate the development of the application. Here is a list of these libraries and the reasons why they were chosen:

  • Coroutines/Flow: Asynchronous programming framework for performing non-blocking operations and managing data flows.
  • Dagger Hilt: Dependency injection library that simplifies the process of managing and injecting dependencies.
  • Retrofit: HTTP client for making network requests and handling responses in Android apps.
  • OkHttp: Library for sending and receiving HTTP requests and responses, with support for interceptors and asynchronous calls.
  • Chuck Interceptor: library to intercept and record HTTP traffic between an Android application and its network.
  • Moshi: JSON parsing library for serializing and deserializing objects to and from JSON.
  • Coil: Image loading library for Android with support for fetching and caching images from various sources.
  • Jetpack Compose: Android UI toolkit for creating composable and declarative UIs.
  • Material3: Material Design components built for Jetpack Compose, providing predefined UI elements.
  • Fastlane: Automation tool for building, testing, and releasing Android applications.

# Libraries for unit testing and instrumentation testing are also included.

[ These libraries are up-to-date as of the project's publication date ]

Screenshots

App Screenshot App Screenshot App Screenshot App Screenshot App Screenshot

Installation

To build and run the application, follow these steps:

  1. Clone the repository.
  2. Open the project in Android Studio.
  3. Sync the project to download the required dependencies.
  4. Build and run the application on an emulator or connected device.

Usage

You can explore the different features and components of the application by navigating through the code and running the app. Additionally, you can use Fastlane for automation tasks such as testing and releasing the application. Mockk can be used for writing unit tests with mocked dependencies.

Contributing

Contributions are welcome! If you have any suggestions, improvements, or bug fixes, feel free to open a pull request. Please follow the established coding style and conventions.

๐Ÿ›  Skills

Kotlin, Android SDK, Clean Architecture, MVVM, Android Architecture Components, Retrofit, Dagger Hilt, Coroutines, Flow, OkHttp, Moshi, Coil, JetPack Compose, Material Design, Fastlane, Git, Junit, Mockk.

License

MIT License

Authors

Used By

This structure is used by the following companies:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.