Skip to content

A simple MVP app that displays most recent Earthquakes across the world

License

Notifications You must be signed in to change notification settings

anilgorthy/MyQuaker

Repository files navigation

Quaker Tracker

Environment

  1. Android Studio 3.2.1
  2. API version info: Compile SDK Version: 28; Min SDK Version: 19; Target SDK Version: 28
  3. Auto-generated the Java classes needed to capture response (GeoJSON) from USGS endpoint using jsonschema2pojo

API Endpoint

  1. For the sake of simplicity and since USGS endpoint does not provide a mechanism to filter the results to a shorter list, I'm fetching 30 day records of Significant Earthquakes
  2. That said, I could have fetched either the Magnitude 1.0 and above or All Earthquakes while displaying a progress spinner/bar and cached the records locally or in-memory for subsequent display and to prevent more network calls

App Notes

  1. Built the app using the Model-View-Pattern (MVP) pattern where the View (Activity) communicates with the Presenter only for handling user interactions as well as for communicating with the model to fetch the data from the APIs
  2. The Retrofit client UsgsRestClient is part of the Model (of MVP pattern) since it calls the API endpoint(s)
  3. This Retrofit client implements a callback for success and failure scenarios
  4. The objects in the Model are just POJOs and do not participate in massaging the data for presentation in the UI, that responsibility is handled by the Adapter
  5. To maintain the position for when the user returns from detail view, I leveraged the Activity lifecycle methods, onPause() and onResume to persist the row item user selected and hence to return the user to that same position, if the user chose not to hide that row item
  6. At the moment, the show/hide functionality is a WIP and so,
    1. show all doesn't refresh with displaying the hidden item(s)
    2. if the user decides to display all (including hidden) row items, then the user can't go back to the hidden row items
  7. Also, the user has to manually disable the display all switch in order to leverage the hide row item capability
  8. Tested the app on Pixel 2 (running OS 9)

Pending (develop branch) tasks

  1. Convert to PURE MVP where Activity passes the type of radio button clicked to Presenter
  2. Ensure unit tests can be written for Presenter

About

A simple MVP app that displays most recent Earthquakes across the world

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages