A comprehensive, robust Android news application built with modern Android development standards. This app allows users to browse breaking news, search for specific topics, filter by categories, and save articles for offline reading. It features a sophisticated offline-caching mechanism ensuring a seamless user experience even without internet connectivity.
Run the app immediately without compiling (CI/CD Automated Build)
- Real-time News Updates: Fetches top headlines and category-based news from NewsAPI.
- Smart Search: Live search functionality with Debouncing to minimize API calls and handle user input efficiently.
- Infinite Scrolling (Pagination): seamless data loading using custom pagination logic to handle large datasets efficiently.
- Offline Support (Caching):
- Caches news locally using Room Database.
- Offline-First approach: Users can view previously loaded news and saved articles without an internet connection.
- Intelligent fallback mechanism: Tries to fetch from Network -> Fails -> Fetches from Cache.
- Bookmarks System: Save articles to "Favorites" stored locally.
- User Authentication:
- Sign Up & Login simulation.
- Persistent Session Management using
SharedPreferences. - Profile Screen with secure Logout functionality.
- Rich UI/UX:
- Jetpack Compose & Material 3 Design.
- Pull-to-Refresh capability.
- Smooth Navigation Transitions (Slide animations).
- Custom Error Handling & User-friendly messages.
- WebView Integration: Read full articles directly within the app.
- Language: Kotlin
- UI Toolkit: Jetpack Compose (Material 3)
- Architecture: Clean Architecture + MVVM (Model-View-ViewModel)
- Dependency Injection: Hilt
- Networking:
- Retrofit2 & OkHttp3
- GSON Converter
- Local Storage:
- Room Database (SQLite abstraction)
- DataStore / SharedPreferences (Session management)
- Asynchronous Programming: Coroutines & Flow
- Image Loading: Coil (with Disk Caching enabled)
- Navigation: Navigation Compose
- Animation: Lottie & Compose Animation API.
The application follows the Clean Architecture principles to ensure separation of concerns, testability, and scalability.
- Presentation Layer (UI):
- Composables (
HomeScreen,DetailsScreen). - ViewModels (
HomeViewModel): Holds the UI state (StateFlow) and handles UI logic.
- Composables (
- Domain Layer:
- Repository Interface: Defines the contract for data operations.
- Data Layer:
- Repository Implementation: Decides whether to fetch data from API or Local DB (Single Source of Truth).
- Data Sources:
- Remote: Retrofit Service (NewsAPI).
- Local: Room DAO & SharedPreferences.
- Android Studio Ladybug (or newer).
- JDK 17+.
- NewsAPI Key.
- Clone the repository:
git clone https://github.com/Ahmedsayed0895/News_App.git
- Open the project in Android Studio.
- Navigate to
local.properties(or your Constants file) and add your API Key:API_KEY="YOUR_API_KEY_HERE"
- Sync Gradle and Run on an Emulator or Physical Device.