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.
This app demonstrates the following views and techniques:
- Retrofit to make api calls to an HTTP web service.
- Moshi which handles the deserialization of the returned JSON to Kotlin data objects.
- Glide to load and cache images by URL.
- Room for local database storage.
- Coroutines as a substitution of RxJava for asynchronous/non-blocking tasks.
- Dagger Hilt for dependency injection
- Timber for logging
- Hamcrest for assertions in tests
- Travis CI for Continuous Integration
It leverages the following components from the Jetpack library:
- ViewModel
- LiveData
- Data Binding with binding adapters
- Navigation with the SafeArgs plugin for parameter passing between fragments
In addition the following features are included:
- Device permission
- Device location
- Dark theme support
-
Android keystore is not being stored in this repository. You need your own keystore to generate the apk / App Bundle
-
You need to have your own Civic API key from Google: the Google Developers Console
-
To ensure sensitive data are not being pushed to Git by accident, the keystore and its passwords are kept one level up of the project folder, so they are not managed by Git.
-
If your project folder is at
/app/nd940-cap/
, the keystore file andkeystore.properties
should be placed at/app/
-
The format of
keystore.properties
is:store=/app/release-key.keystore alias=<alias> pass=<alias password> storePass=<keystore password> civicApiKey="<your API Key here>"
./gradlew installDebug
// or
// ./gradlew installRelease
- Options are:
Debug
,Release
- Debug builds will have an App package name suffix
.debug
After August 2021, all new apps and games will be required to publish with the Android App Bundle format.
./gradlew clean bundleRelease
./gradlew clean assembleRelease
- The generated apk(s) will be stored under
app/build/outputs/apk/
- Other usages can be listed using
./gradelew tasks