You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create a file named api.properties in the root folder
Define two constant variables named API_BASE_URL and API_KEY inside it.
Get an API key from https://newsapi.org
root folders
api.properties
Project Folder Structure
Project Folder Structure
Description
The folder structure of the project is as shown on the left. The Clean Architecture approach has been used. Below are the explanations and details of the folders.
core
data
di
domain
presentation
core folder
core Folder
Description
This folder generally contains semi-independent classes from the project, project-specific constants, enums, and utilities.
data folder
data Folder
Description
This folder contains classes where we get, manage, and distribute the data.
di folder
di Folder
Description
This folder is where we manage dependency injection.
domain folder
domain Folder
Description
This folder is where we can access data from a single repository and manage our use-cases
presentation folder
presentation Folder
Description
This folder is where we manage our UI components. We manage many components such as Activities, Fragments, ViewModels, and Adapters in this folder.
App.kt file
This class extends the Application class and is annotated with the @HiltAndroidApp annotation.
@HiltAndroidApp
class App: Application()
Project Architecture
In this project, a modular architecture is designed using Clean Architecture and MVVM approaches to make the development and maintenance of the application easier. Clean Architecture ensures that each layer of the application is independent of each other and responsible for a specific task.