Project Structure

The illustration above represents the structure of the app that we’ll use to learn everything about the MVVM architecture. The application’s name is GlobalNewsApp, and it is basically an app that displays a list of news articles. The following are its features:

  • Listing articles: The app should display a list of articles.
  • Pagination: It’s a library that allows us to load a small amount of data at a time on the screen, and in our case, the list of articles is broken down into smaller chunks and loaded one at a time, providing a smooth scrolling effect, improving the user experience.
  • WebView: This allos us to read our articles inside our application.
  • Make a list of favorite articles: A user is going to be able to select theirfavorite articles to read later on either online or offline, and the feature makes full use of the Room database.
  • Offline capabilities: When the device is offline, the application will load the most recently viewed list of articles from the Room local database to the user interface and update it with a new list of articles when it reconnects to the internet.

Search: This is the capability to search for a specific article or topic.

Project files

In Android, files are grouped inside modules, and we only have the app module in our NewsApplication.However, we can have as many modules as we like depending on the size and architecture of the application. Let’s analyze them.

Code structure

The image below shows our project structure.

Get hands-on with 1200+ tech skills courses.