Astro Photos 🔭

Astro Photos downloads and displays random space photos from NASA API.

Astro Photos is implemented using Android Clean Architecture, Retrofit2, Dagger Hilt, ViewModel, Coroutines, Room, Navigation Components and some other libraries from the Android Jetpack.

Get it on Google Play

Architecture

The Architecture of this application relies and complies with the following points:

  • Has 3 Screen destination which use Compose Destination to manage navigation
  • Uses Model-View-ViewModel (MVVM) pattern with Clean Architecture (data, domain and presentation)

Clean Architecture

Tech Stack

Technologies used:

  • Android KTX - helps to write more concise, idiomatic Kotlin code.
  • Jetpack Compose - modern toolkit for building native Android UI
  • Material Design 3 - an adaptable system of guidelines, components, and tools that support the best practices of user interface design.
  • Compose Destinations - used to handle all navigations and arguments passing while hiding the complex, non-type-safe and boilerplate code
  • ViewModel to store and manage UI-related data in a lifecycle conscious way.
  • Dagger Hilt - used for Dependency Injection.
  • Coil - an image loading library for Android backed by Kotlin Coroutines
  • Moshi - Android JSON parser for converting JSON string into Kotlin objects.
  • Retrofit a REST Client for Android which makes it relatively easy to retrieve and upload JSON (or other structured data) via a REST based webservice.
  • Coroutines and Kotlin Flow - used to manage the local storage i.e. writing to and reading from the database. Coroutines help in managing background threads and reduces the need for callbacks.
  • Room persistence library which provides an abstraction layer over SQLite to allow for more robust database access while harnessing the full power of SQLite.
  • Timber - a logger with a small, extensible API which provides utility on top of Android's normal Log class.
  • Lottie Animations - provides Lightweight and scalable animations files

Deployment

Instant Weather requires a minimum API level of 21. Clone the repository or download the code directly.

You will need an API key i.e. API_KEY from NASA Open APIs to request data.

Each record follows this structure:

{
        "copyright": "Robert Gendler",
        "date": "2008-11-27",
        "explanation": "Large galaxies grow by eating small ones ..,
        "media_type": "image",
        "service_version": "v1",
        "title": "Galaxies in the River",
        "url": "https://apod.nasa.gov/apod/image/0811/NGC1532_gendler_c800.jpg"
    }
  

API Reference

Get a list of Astro Photos

  GET planetary/apod
Parameter Type Description
api_key String Required. Your API key
count Int Required. Your API key

Returns a list of APODs (Astronomy Picture of the Day)

Contributing

Contributions are always welcome!

Contribution

All contributions are welcome. If you are interested in seeing a particular feature implemented in this app, please open a new issue after which you can make a PR!

Alt

License

MIT License

Copyright (c) [2022] [Tonnie Dev]

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:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.