Awesome
Planet escape: Rocket launches schedule (Work in progress 🚧👷🏗️️)
An android app that shows timeline of upcoming rocket launches. Showcases architecture of a real android application and usage of some libraries. Application loads data about rocket launches from the server and stores them to the database for off-line usage.
Screenshots
Goals
- Modularize the application into modules
App
andDomain
.Domain
module has no android dependencies. - Focus on testability with unit tests and UI tests. For UI tests is used the Espresso library with the Robot pattern which allows to create clear and understandable tests.
- Use kotlin coroutines for asynchronous jobs.
Libraries Used
-
ViewModel - Store UI-related data that isn't destroyed on app rotations.
-
Room - Store launch data received from the server in SQLite database.
-
Data Binding - Declaratively bind observable data to UI elements.
-
Lifecycles - Handle events from ViewModel to Fragments/Activity.
-
WorkManager - Used for periodic data fetching from server and for showing Android notification of upcoming launch.
-
Navigation - Handle everything needed for navigation between fragments and creation of deep links.
-
Kotlin Coroutines For managing asynchronous calls with simplified code and reducing needs for callbacks. For event based code are used
Flow
-s andChannel
-s. -
Dependency injection
- Dagger 2 Creates dependency graph for most object in the application.
- Assited-Inject Easier creation of objects that combine parameterization and dependencies. Mainly used with ViewModels.
-
Material components Application uses material theme for easier styling of UI components and for dark theme.
Getting started
- App can work without the server. When app is build with parameter
use_fake_reponse_api=true
in thegradle.properiets
, a response is generated from static JSON file in the assets. - Otherwise, if server is used, number of requests per minute is limited.
Gradle tasks
-
run UI tests on connected device:
./gradlew connectedDebugAndroidTest
-
run unit tests:
./gradlew testDebugUnitTest
-
assemble apk:
./gradlew assembleDebug
Environment variables (optional)
-
SPACE_APP_KEYSTORE_PASSWORD
-
SPACE_APP_KEY_PASSWORD
-
SPACE_APP_KEYSTORE_PATH
-
SPACE_APP_API_KEY
- key will be used for communication with server
License
Copyright 2022 Valter Kasper
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.