🗡️ Newzfi demonstrates modern Android development with Hilt, Coroutines, Flow, Jetpack (Room, ViewModel), and Material Design based on MVVM architecture.
A newzfi app is a mobile application that provides users with up-to-date news and information from various sources, typically in a user-friendly and customizable format. These apps offer news on various topics, including politics, sports, entertainment, business, and more.
- Minimum SDK level 21
- Kotlin based, Coroutines + Flow for asynchronous.
- Jetpack
- Lifecycle: Observe Android lifecycles and handle UI states upon the lifecycle changes.
- ViewModel: Manages UI-related data holder and lifecycle aware. Allows data to survive configuration changes such as screen rotations.
- DataBinding: Binds UI components in your layouts to data sources in your app using a declarative format rather than programmatically.
- Firebase Auth: provides backend services, easy-to-use SDKs, and ready-made UI libraries to authenticate users to your app.
- Hilt: for dependency injection.
- Architecture
- MVVM Architecture (View - DataBinding - ViewModel - Model)
- Repository Pattern
- Retrofit2 & OkHttp3: Construct the REST APIs and paging network data.
- Material-Components: Material design components for building ripple animation, and CardView.
- Glide, GlidePalette: Loading images from network.
Newify is based on the MVVM architecture and the Repository pattern, which follows the Google's official architecture guidance.
The overall architecture of Newify is composed of two layers; the UI layer and the data layer. Each layer has dedicated components and they have each different responsibilities, as defined below:
Newify was built with Guide to app architecture, so it would be a great sample to show how the architecture works in real-world projects.
- Each layer follows unidirectional event/data flow; the UI layer emits user events to the data layer, and the data layer exposes data as a stream to other layers.
- The data layer is designed to work independently from other layers and must be pure, which means it doesn't have any dependencies on the other layers.
With this loosely coupled architecture, you can increase the reusability of components and scalability of your app.
The UI layer consists of UI elements to configure screens that could interact with users and ViewModel that holds app states and restores data when configuration changes.
- UI elements observe the data flow via DataBinding, which is the most essential part of the MVVM architecture.
- With Bindables, which is an Android DataBinding kit for notifying data changes, you can implement two-way binding, and data observation in XML very clean.
The data Layer consists of repositories, which include business logic, such as querying data from the local database and requesting remote data from the network. It is implemented as an offline-first source of business logic and follows the single source of truth principle.
Newify adopted modularization strategies below:
- Reusability: Modulizing reusable codes properly enable opportunities for code sharing and limits code accessibility in other modules at the same time.
- Parallel Building: Each module can be run in parallel and it reduces the build time.
- Strict visibility control: Modules restrict to expose dedicated components and access to other layers, so it prevents they're being used outside the module
- Decentralized focusing: Each developer team can assign their dedicated module and they can focus on their own modules.
For more information, check out the Guide to Android app modularization.
Newify using the NewsAPI for constructing RESTful API.
newsAPI provides a RESTful API interface to highly detailed objects built from thousands of lines of data related to news.
for this repository. ⭐
Also, follow me on GitHub for my next creations! 🤩
MIT License
Copyright (c) 2023 Utkarsh Singh
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: