Welcome to the .NET Maui News App! This dynamic application offers users a seamless experience in accessing news articles tailored to their preferences. Developed using .NET Maui, the app provides a robust framework for cross-platform functionality while integrating SQLite for efficient local database management. One of the app's key features is its utilization of the News API, harnessing the power of HTTPS GET requests to fetch real-time news data.
Navigate through an extensive array of news categories to discover articles that align with your interests. Whether it's politics, technology, sports, or entertainment, the app ensures that you stay informed on topics that matter to you.
Looking for something specific? Utilize the search functionality to quickly find articles by entering relevant keywords. With just a few taps, access the information you need with ease.
Personalize your news reading experience by marking articles as favorites. A simple swipe right enables you to save noteworthy articles for later perusal. Conveniently access your favorite articles through the dedicated favorites icon located in the bottom-right corner.
Favourites use SQLite to store the data locally on your device. Add, delete, fetch, search CRUD operations are implemented for smooth operation of Favourites. When Favourites page is loaded it fetches all data from database to load the favourites list.
Explore your curated collection of favorite articles in one centralized location. The favorites page provides intuitive controls for managing your saved articles, including options to add, delete, and fetch articles as desired.
Delve deeper into the content that catches your eye by tapping on individual articles. The app seamlessly transitions to a details page, presenting comprehensive information such as the article's title, accompanying image, and insightful content. Additionally, a convenient button allows for seamless navigation to the original article link, providing access to the full story.
In the .NET Maui News App, the Model-View-ViewModel (MVVM) architectural pattern is implemented to ensure a well-structured, maintainable, and testable codebase. This architecture separates the application into three distinct layers: Models, Views, and ViewModels, each with its responsibilities. Additionally, services are utilized to encapsulate business logic and promote reusability. Let's explore how MVVM is applied in the app:
- ArticleModel
- CategoryModel
- FavoritesModel
- RootModel
- SourceModel
- ArticleDBModel
- ArticleViewModel
- CategoryViewModel
- NewsViewModel
- DetailsPage
- FavouritesPage
- HomePage
- ApiService
- DatabaseService
In the .NET Maui News App, we integrate with the News API from newsapi.org to retrieve real-time news data. This integration falls under cloud integration as it connects our application to an external service hosted on the cloud. As developers, we utilize the free version of the API to access essential functionalities for fetching news articles.
The News API offers various endpoints that allow us to tailor our news retrieval based on specific parameters:
- Search: Users can search for news articles using keywords. We incorporate parameters such as language, country, and topic to narrow down the search results.
- Language and Country: Users can specify the language and country preferences for the news articles they wish to view.
- Topic: Users can select specific topics of interest, such as politics, technology, sports, or entertainment.
- Pagination: The API returns a paginated response, providing up to 20 articles per request.
The API responds with news articles in JSON format, making it easy for our application to parse and extract relevant information. Each article object typically contains details such as title, description, author, source, published date, and a link to the full article.
As we're using the free version of the News API for developers, there may be certain limitations to consider, such as request rate limits, daily usage quotas, and restricted access to premium features. However, for the scope of our application, the free tier offers sufficient functionality to meet our needs and provide users with valuable news content.
By integrating with the News API, we enhance the capabilities of our .NET Maui News App, enriching the user experience with timely and relevant news articles sourced from reputable sources across the globe.
We split our app into three parts:
- Models: These hold the data, like news articles and user info.
- Views: This is what users see and interact with, like the screens showing news articles.
- ViewModels: They connect the models and views, handling stuff like fetching news and updating the screen.
We keep our data separate from the rest of the app. So when we need to save or get news articles, we have a special place (repository) to handle that without making a mess elsewhere.
This helps us manage who talks to whom. If one part of the app needs help from another part, we use dependency injection to make that happen without causing confusion or chaos.
We turn user actions (like tapping on an article) into little packages called commands. This makes it easier to handle what happens when users do things, like saving articles or opening links.
Certain important things (like the database where we keep our articles) should only exist in one place at a time. So, we use the Singleton pattern to make sure there's only one of them, avoiding any mix-ups.
By using these tricks, our app stays organized, works smoothly, and makes life easier for both users and developers.
Getting started with the .NET Maui News App is a breeze! Follow these simple steps to set up the application on your device:
-
Clone the Repository: Begin by cloning the project repository to your local machine using the following command:
git clone https://github.com/CezarAmanedddine/6002CEM_CezarAmanedddine.git
-
Navigate to the Project Directory: Use the terminal or command prompt to navigate to the cloned repository directory:
cd your-repository
-
Restore NuGet Packages: Restore the necessary NuGet packages by executing the following command:
dotnet restore
-
Build and Run the Application: Build the project and launch the application using the following commands:
dotnet build dotnet run
The .NET Maui News App leverages a range of dependencies to deliver its robust functionality:
- .NET Maui: Empowering cross-platform development with a unified framework.
- SQLite: Providing seamless local database storage for efficient data management.
- News API: Harnessing the power of real-time news data through HTTPS GET requests.
- Insert any additional dependencies or libraries used within the application.
Discovering and consuming news content has never been more effortless. Here's how to make the most of the .NET Maui News App:
- Explore Categories: Upon launching the app, dive into an extensive selection of news categories to find articles that pique your interest.
- Search for Articles: Need to find something specific? Utilize the search feature to quickly locate articles based on keywords relevant to your query.
- Mark Favorites: Swipe right on any article to mark it as a favorite and add it to your personalized collection.
- Access Favorites: Easily access your favorite articles through the dedicated favorites icon located in the bottom-right corner of the screen.
- Manage Favorites: Head to the favorites page to manage your curated collection of favorite articles. Perform actions such as adding, deleting, and fetching articles with intuitive controls.
- Explore Article Details: Tap on any article to delve deeper into its content. Discover insightful details, including the article's title, accompanying image, and full content. With the tap of a button, seamlessly navigate to the original article link for further reading.
Contributions to the .NET Maui News App are highly valued and welcomed! If you're interested in contributing to the project, here's how you can get involved:
- Fork the Repository: Begin by forking the project repository to your GitHub account.
- Create a New Branch: Set up a new branch for your contributions, ensuring isolation and ease of collaboration.
- Make Your Changes: Implement your desired features, enhancements, or bug fixes within the new branch.
- Commit Your Changes: Once your changes are complete, commit them with clear and descriptive messages.
- Push Your Changes: Push your committed changes to your forked repository.
- Create a Pull Request: Finally, create a pull request to propose your changes for review and integration into the main project.
This project is licensed under the MIT License - see the LICENSE file for details.
The .NET Maui News App extends its gratitude to the following individuals and resources for their invaluable contributions and support:
- News API: Providing access to real-time news data, enriching the app's content and functionality.
- Insert any additional acknowledgments or credits here.