Jan Samachar is a simple and modern Android news application built with Kotlin. It fetches the latest top headlines from the NewsAPI and displays them in a clean, user-friendly interface. This project demonstrates modern Android development practices, including a clean architecture, asynchronous data fetching, and secure API key management.
- 📰 Top Headlines: Fetches and displays the top news headlines from the US.
- 🔄 Swipe to Refresh: Users can swipe down to refresh the news feed.
- ♾️ Infinite Scrolling: Automatically loads more articles as the user scrolls to the bottom.
- 🖼️ Detailed View: Click on any article to see its full details in a separate screen.
- ❤️ Interactive UI: Includes placeholder like/dislike, comment, and share functionality on each article.
- 📱 Responsive Layout: Adapts its layout for both phones (single column) and tablets (grid view).
- 🔒 Secure API Key: The NewsAPI key is stored securely and is not exposed in the version-controlled code.
⚠️ Error Handling: Shows user-friendly messages for network errors or when news fails to load.
- Language: Kotlin
- Architecture: MVVM (Model-View-ViewModel)
- Asynchronous: Kotlin Coroutines for managing background threads.
- Networking: Retrofit for making API calls.
- Database: Room for saving favorite articles locally.
- UI & Navigation:
- Android Jetpack's Navigation Component
- RecyclerView & CardView
- ViewBinding
- Image Loading: Glide for efficient image loading and caching.
To build and run this project locally, follow these simple steps:
-
Clone the repository:
git clone <your-repository-url>
-
Get a NewsAPI Key:
- Go to newsapi.org and register to get your free API key.
-
Create
local.propertiesfile:- In the root directory of the project (the same folder where
build.gradle.ktsis), create a new file namedlocal.properties.
- In the root directory of the project (the same folder where
-
Add your API Key:
- Open the
local.propertiesfile and add your API key in the following format:
NEWS_API_KEY="YOUR_NEWS_API_KEY_HERE"
Replace
YOUR_NEWS_API_KEY_HEREwith the actual key you got from newsapi.org. - Open the
-
Build and Run:
- Open the project in Android Studio.
- Let Gradle sync all the dependencies.
- Run the app on an emulator or a physical device.
(You can add screenshots of your application here to showcase the UI)
| Headlines Screen |
| Article Detail Screen |
| Favourite Section Screen | ( Dark Mode )


