Skip to content
/ Quakes Public

With Quakes app, stay updated with the latest information about earthquakes around the world.

License

Notifications You must be signed in to change notification settings

AsemLab/Quakes

Repository files navigation

Quakes

Quakes demonstrates modern Android development with Google Maps SDK, Firebase, Hilt, Coroutines, Flow, Navigation component, Jetpack (Room, ViewModel, Paging3) based on MVVM architecture.

Screenshots

Features

🌐 Global Coverage: Stay informed about earthquakes happening worldwide. Track magnitude, depth, and location with detailed maps and reports.

📅 Historical Data: Access a comprehensive earthquake archive dating back to 1960., helping you analyze patterns and trends over time.

Tech stack & Open-source libraries

  • Minimum SDK level 22
  • Kotlin based, Coroutines + Flow for asynchronous.
  • Jetpack
    • Lifecycle: Performs actions in response to a change in the lifecycle status of another component, such as activities and fragments.
    • ViewModel: Exposes state to the UI and encapsulates related business logic. Its principal advantage is that it caches state and persists it through configuration changes.
    • DataBinding: Binds UI components in your layouts to data sources in your app using a declarative format rather than programmatically.
    • Navigation: Helps you implement navigation, from simple button clicks to more complex patterns, such as app bars and the navigation drawer.
    • Room: Provides an abstraction layer over SQLite to allow for more robust database access while harnessing the full power of SQLite.
    • Hilt: For dependency injection.
    • Paging3: Helps you load and display pages of data from a larger dataset from local storage or over a network.
  • Architecture
    • MVVM Architecture (View - DataBinding - ViewModel - Model)
    • Repository Pattern
  • Google Maps utils: Contains utilities that are useful for a wide range of applications using the Google Maps SDK for Android. Used to customize Marker icon & clustring.
  • Google play In-App update: prompts active users to update your app.
  • Firebase Cloud Messaging: Sends notification messages to client app.
  • Retrofit2 & OkHttp3: A type-safe HTTP clients for Android and Java.
  • Gson: A Java serialization/deserialization library to convert Kotlin Objects into JSON and back.
  • Gradle’s Kotlin DSL: Provides an alternative syntax to the traditional Groovy DSL with an enhanced editing experience in Android Studio.
  • Material-Components: Enables a reliable development workflow to build beautiful and functional Android apps.
  • Glide: Is a fast and efficient open source media management and image loading framework for Android.
  • UtilCode: Is a powerful & easy to use library for Android. This library encapsulates the functions that commonly used in Android development.
  • Coil: An image loading library for Android backed by Kotlin Coroutines. Used to load svg images from network.
  • Splash screen API: lets apps launch with animation, including an into-app motion at launch, a splash screen showing your app icon, and a transition to your app itself.

Architecture

Quakes is based on the MVVM architecture and the Repository pattern, which follows the Google's official architecture guidance.

The overall architecture is composed of two layers, the UI layer and the data layer. Each layer is made up of multiple components, each with different responsibilities.

UI Layer

The role of the UI is to display the application data on the screen and also to serve as the primary point of user interaction. Whenever the data changes, either due to user interaction (like pressing a button) or external input (like a network response), the UI should update to reflect those changes.

It consists of two components:

  • UI elements: activities and fragments that display the data.
  • State holders: the classes that are responsible for the production of UI state and contain the necessary logic for that task, such as ViewModel.

Data Layer

It contains application data and business logic. The business logic is what gives value to the app — it's made of real-world business rules that determine how application data must be created, stored, and changed.

The data Layer consists of EarthquakeManager which in turn contains two repositories:

  • EarthquakesRepo: Queries event data from the local database and requesting remote data from the network.
  • CountriesRepo: Queries countries data, such as name, and flag, from the local database and requesting remote data from the network.

Modularization

Quakes is developed with multi-modules according to Google's official modularization guidance, which has the following benefits:

  • Improve maintainability
  • Improve quality
  • Reusability
  • Encapsulation
  • Testability
  • Build time

Open API

Quakes using the following APIs:

  • United States Geological Survey USGS: Provides real-time data on earthquakes worldwide, including information such as magnitude, location, and time of the event.
  • restcountries: Provides information about countries such as flag, population, and currency.

License

Designed and developed by 2023 AsemLab (Asem Abu Alrub)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.