APODNasa app
About
App related to show Astronomy Picture of the Day(APOD) for last seven days. An app to show media listing using APOD api having image/gif/video.
- Always loading Media from local database (room). Remote data (from API) and Local data is always synchronized.
- App can load media listing, details offline.
- Clean and Simple Material UI.
- Supporting dart-light theme.
- Daily pictures sync up in the morning
Run a project
- Go to https://api.nasa.gov/#signUp and create/request new api key.
- Put generated api key in
local.properties
with property nameAPI_KEY
. Now sync project and run the app. - Now navigate to “Browse APIs” → Expand APOD
- API Base Url is https://api.nasa.gov/planetary/apod
- Further query params to fetch in a date range are provided in the document
- Example api call having all type of media including image/gif/video : https://api.nasa.gov/planetary/apod?start_date=2022-05-01&end_date=2022-05-31&thumbs=true&api_key=[your_api_key]
Package Structure
- Root package:
com.pranay.apodnasa
data
: For data handling.local
: Classes related to manage local data using rooom databaseremote.api
: classes related to call remote api to get api datarepository
: repository classes to manage and fetch local/remote data
di
: provide hilt related dependency config classesmodel
: model class related response, database table etcui
: UI related classes include default activity and fragment destination of navigationutil
: Utility Classes / Kotlin extensionsworker
: Created work manger worker to get scheduled api call to get APOD data and store in database
📷
Screenshots
Dark theme | |||
---|---|---|---|
Media listing | Media listing with video item | Media item details | Video media item details |
Light theme | |||
Architecture
This app uses MVVM (Model View View-Model) architecture.
🛠
Built With - Kotlin : First class and official programming language for Android development.
- Android Studio : The Official IDE for Android
- Gradle : Build tool for Android Studio
- Coroutines : For asynchronous and more..
- Flow : A cold asynchronous data stream that sequentially emits values and completes normally or with an exception.
- Android Architecture Components : Collection of libraries that help you design robust, testable, and maintainable apps.
- ViewModel : Stores UI-related data that isn't destroyed on UI changes.
- ViewBinding - Generates a binding class for each XML layout file present in that module and allows you to more easily write code that interacts with views.
- Navigation : for Fragment navigation
- WorkManager : Primary recommended API for background processing.
- Room : SQLite object mapping library to store local data
- Material Components for Android : Modular and customizable Material Design UI components for Android.
- Dependency Injection :
- Hilt-Dagger : Standard library to incorporate Dagger dependency injection into an Android application.
- Hilt-ViewModel : DI for injecting
ViewModel
.
- Retrofit : A type-safe HTTP client for Android and Java. Using for network api call.
- Gson Converter : A Converter which uses Gson for serialization to and from JSON.
- Glide - open source media management and image loading framework for Android
- sdp and ssp : Provide common dimens sizes to support different screen wise size
Other points
- Using
navGraphViewModels
extension for ViewModel that provide maintain data across given navigation graph to completed selling produce and show selling produce info on next page. - Using Navigation Animation for screen navigation
App color theming
- Using color theming from Foodium app
Contribute
- If you want to contribute to this library, you're always welcome! See Contributing Guidelines.
✉️
Get in touch!
❤️
Find this project useful ? - Support it by clicking the
⭐️ button on the upper right of this page.✌️
License
- See License