Skip to content

Built a sleek Android news reader app using Kotlin with global news browsing, search functionality, and offline article saving.

Notifications You must be signed in to change notification settings

mukund-rakholiya/The-News-Application

Repository files navigation

📱 NewsApp - Your Personalized News Reader

Welcome to NewsApp, a sleek and efficient Android application built using Kotlin. With NewsApp, you can stay updated with the latest news worldwide, thanks to its seamless integration with the NewsAPI 📰✨.


🚀 Features

  • 🌍 Browse Global News: Stay informed with the latest headlines from around the world.
  • 🔍 Search Functionality: Quickly find news articles with an optimized search feature.
  • 📁 Offline Access: Save articles to read later, even without internet.
  • 🧑‍💻 Built with Kotlin: Leveraging modern and robust technology for a smooth experience.

🛠️ Directory Structure

Here's a quick look at the main components of the application:

1. Adapters

  • ArticleAdapter: Bridges the RecyclerView and your news data, providing a polished UI for articles.

2. API

  • NewsAPI: Interface containing endpoints to fetch news.
  • RetrofitInstance: Configures Retrofit with the base URL and converter factory.

3. Database

  • ArticleDao: Manages database operations for saved articles.
  • ArticleDatabase: Handles database creation and versioning using Room.
  • Converters: Helps store complex data types in the database.

4. Models

  • Classes like Article, Source, and NewsResponse model the data structure fetched from the NewsAPI.

5. Repository

  • Manages data flow between the local database and remote API, ensuring efficiency and reliability.

6. UI

  • Activities & Fragments:
    • MainActivity: Hosts the app's core navigation.
    • ArticleFragment: Displays detailed news articles.
    • BreakingNewsFragment: Showcases the latest news.
    • SavedNewsFragment: Lists all saved articles.
    • SearchNewsFragment: Enables keyword-based searches.

7. Util

  • Constants: Houses key app configurations like API key and base URL.
  • Resource: A sealed class to represent different states (loading, success, error) during API calls.

🛑 Prerequisites

  • Kotlin 1.5+
  • Android Studio Bumblebee+
  • A valid API key from NewsAPI.

🔧 How to Run

  1. Clone this repository:

    git clone https://github.com/yourusername/NewsApp.git```
    
  2. Open the project in Android Studio.

  3. Add your NewsAPI key to Constants.kt:

const val API_KEY = "your_api_key_here"
  1. Build and run the app on an emulator or physical device.

🤝 Contribution

  • Contributions are always welcome! Feel free to fork this repo, make your changes, and submit a pull request.

📜 License

  • This project is licensed under the MIT License.

🌟 Acknowledgments

  • NewsAPI for providing reliable news data.
  • Android and Kotlin communities for their invaluable resources.

Happy coding! 💻✨

About

Built a sleek Android news reader app using Kotlin with global news browsing, search functionality, and offline article saving.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages