Political Preparedness is a Capstone project I have submitted for graduating from the Udacity Android Developers Kotlin Nanodegree program in September 2021. As already being assessed in previous coursework, Udacity did not award extra marks for writing tests in this project.
So I have followed a practical approach - by submitting what they have asked for in the rubric in order to graduate. After graduation, now I keep on refactoring the codes, improving the UI layout and adding tests to this project.
If you want to try out the app without building it, check out the Releases section where you can find the APK and App Bundles for each major version. A working Civic API key was applied when building the app, therefore you can test it by just installing it.
Planned enhancements are now logged as issues.
- Kotlin
- Kotlin Coroutines and Flow
- MVVM & clean architecture
- XML Views
- Device permission
- Device location
- Dark theme support
- Dependency Injection using Dagger Hilt
- Gradle Kotlin DSL and Version Catalog
- Robolectric database tests
- AndroidX Activity KTX - Apache 2.0 - Extensions for Android Activity
- AndroidX Core KTX - Apache 2.0 - Extensions for Android Core
- AndroidX Core Testing - Apache 2.0 - Core testing utilities
- AndroidX Espresso - Apache 2.0 - UI testing framework for Android
- AndroidX Fragment KTX - Apache 2.0 - Extensions for Android Fragment
- AndroidX Fragment Testing - Apache 2.0 - Utilities for testing fragments
- AndroidX Navigation KTX - Apache 2.0 - KTX extensions for Navigation components
- AndroidX Room - Apache 2.0 - Database access with annotation processing and Kotlin extensions
- Jetpack Compose UI - Apache 2.0 - Modern declarative UI toolkit with testing and tooling support
- AndroidX Material3 - Apache 2.0 - Material Design 3 components for Compose
- ConstraintLayout - Apache 2.0 - Constraint-based layout system
- AndroidX UIAutomator - Apache 2.0 - UI automation testing library for Android
- Dexmaker Mockito - Apache 2.0 - DexMaker-based Mockito implementation for Android
- Glide - BSD - Image loading and caching library for Android
- Hilt for Android - Apache 2.0 - Dependency injection with compile-time DI and testing support
- JUnit + AndroidX Extensions - Apache 2.0 / EPL - JUnit 4 with AndroidX KTX support for instrumented tests
- Kotlin Standard Library - Apache 2.0 - Core language features for Kotlin
- Kotlin Reflect - Apache 2.0 - Reflection support for Kotlin
- Kotlinx Coroutines - Apache 2.0 - Support for asynchronous and concurrent programming in Kotlin
- AndroidX Lifecycle LiveData KTX - Apache 2.0 - Kotlin extensions for LiveData
- AndroidX Lifecycle ViewModel KTX - Apache 2.0 - Kotlin extensions for ViewModel
- Material Components - Apache 2.0 - Material Design UI components for Android
- Mockito Core - MIT - Java mocking framework for unit tests
- Moshi - Apache 2.0 - Modern JSON library for Android and Java with Kotlin and adapter support
- Play Services Location - Apache 2.0 - Location services from Google Play
- Retrofit - Apache 2.0 - Type-safe HTTP client for Android and Java
- Retrofit Kotlin Coroutines Adapter - Apache 2.0 - Coroutine support for Retrofit
- Robolectric - Apache 2.0 - JVM-based unit testing framework for Android
- Timber - Apache 2.0 - Lightweight logging library for Android
- Android Application Plugin - Google - Plugin for building Android applications
- Jetbrains Kotlin Android Plugin - JetBrains - Plugin for Kotlin Android projects
- Compose Compiler Plugin - JetBrains - Compose plugin for Kotlin
- Hilt Android Plugin - Google - Plugin for Hilt Android dependency injection
- Kover Plugin - JetBrains - Code coverage tool for Kotlin
- KSP Plugin - Google - Kotlin Symbol Processing API
- Android Test Plugin - Google - Plugin for Android test projects
- Serialization Plugin - JetBrains - Plugin for Kotlin serialization
- Navigation Safe Args Plugin - AndroidX - Plugin for type-safe navigation
- Detekt Plugin - Artur Bosch - Static code analysis for Kotlin
- Kotlinter Plugin - Jeremy Mailen - Plugin for Kotlin linting
- To build the app by yourself, you need your own Civic API key from Google
- You can then either provide the API key in a
keystore.properties
file (civicApiKey
), or set it as an environment variableCIVIC_API_KEY
By default, debug builds do not require a keystore. You can run:
./gradlew assembleDebug
No signing config is required unless you explicitly build a release variant.
Signing configuration is only triggered when:
- the task includes "Release" or "Bundle"
- or the environment variable
CI=true
is set
There are two ways to supply the keystore:
Provide the following environment variables (e.g. in GitHub Secrets):
KEYSTORE_LOCATION=./keystore.jks
CI_ANDROID_KEYSTORE_ALIAS=yourAlias
CI_ANDROID_KEYSTORE_PASSWORD=yourKeystorePassword
CI_ANDROID_KEYSTORE_PRIVATE_KEY_PASSWORD=yourPrivateKeyPassword
CIVIC_API_KEY=yourCivicApiKey
Create a keystore.properties
file at the root:
alias=yourAlias
pass=yourPrivateKeyPassword
store=path/to/keystore.jks
storePass=yourKeystorePassword
civicApiKey=yourCivicApiKey
Then build:
./gradlew bundleRelease
Release builds are timestamped using the format:
<app-name>-<buildType>-<versionName>-<yyyyMMdd-HHmmss>.apk
This applies to both APK and AAB artifacts.