Android news app built using Kotlin and implemented MVVM architecture. It requests news from News api with help of Retrofit library.
- Display News in various categories
- Share news with friends
- Browse news
- Bookmark news to read later/ Delete news
![]() |
![]() |
![]() |
- Generate API key from News api
- Paste the key in gradle.properties
API_KEY="<YOUR_API_KEY>"
- Rebuild app
MVVM is one of the architectural patterns which enhances separation of concerns, it allows separating the user interface logic from the business (or the back-end) logic. Its target (with other MVC patterns goal) is to achieve the following principle "Keeping UI code simple and free of app logic in order to make it easier to manage".
|
-
Entity: Annotated class that describes a database table when working with Room.
-
SQLite database: On device storage. The Room persistence library creates and maintains this database for you.
-
DAO: Data access object. A mapping of SQL queries to functions. When you use a DAO, you call the methods, and Room takes care of the rest.
-
Room database: Simplifies database work and serves as an access point to the underlying SQLite database (hides SQLiteOpenHelper). The Room database uses the DAO to issue queries to the SQLite database.
-
Repository: Used to manage multiple data sources.
-
ViewModel: Acts as a communication center between the Repository (data) and the UI. The UI no longer needs to worry about the origin of the data. ViewModel instances survive Activity/Fragment recreation.
-
LiveData: A data holder class that can be observed. Always holds/caches the latest version of data, and notifies its observers when data has changed.
Retrofit is a type-safe REST client for Android, Java and Kotlin developed by Square. The library provides a powerful framework for authenticating and interacting with APIs and sending network requests with OkHttp.