Skip to content

An Android-Kotlin-MVVM application that provides civic data intended to provide educational opportunities to the U.S. electorate using data provided by the Google Civic Information API.

License

Notifications You must be signed in to change notification settings

ryanw-mobile/nd940-cap-advanced-android-programming-project

Repository files navigation

Political Preparedness
Gradle Build Renovate enabled Codacy Badge Codacy Badge

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.

Screenshot1 Screenshot2 Screenshot3 Screenshot4 Screenshot5 Screenshot6 Screenshot7

Binaries download

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.

 

To-do lists

Planned enhancements are now logged as issues.

 

High level architecture

  • 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

 

Major libraries used

Dependencies

Plugins

 

Building the App

Requirements

  • 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 variable CIVIC_API_KEY

Without Keystore (Debug Builds)

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.

With Keystore (Release Builds)

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:

1. Environment Variables (For CI)

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

2. keystore.properties File (For Local Builds)

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

Output Format

Release builds are timestamped using the format:

<app-name>-<buildType>-<versionName>-<yyyyMMdd-HHmmss>.apk

This applies to both APK and AAB artifacts.

About

An Android-Kotlin-MVVM application that provides civic data intended to provide educational opportunities to the U.S. electorate using data provided by the Google Civic Information API.

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

Contributors 2

  •  
  •  

Languages