Skip to content

Development

Spencer Williams edited this page Jan 11, 2021 · 5 revisions

Overview

This app is open-source and contributions are welcome! This app is developed in Java using Android Studio and the source code lives here on GitHub, and is versioned using Git.

If you're new to app development, Git, GitHub, or Android Studio, there are plenty of tutorials and documents online to help you get started! For complete beginners, here's what these words mean:

Tool Description
Java Programming language used to define the logic of the app (i.e. how the app looks, feels, and behaves)
Android Studio Program that helps make writing, testing, and building the app easier. This type of program is called an "IDE" (Integrated Development Environment), and is much easier than write program files and folders using simple text editors.
GitHub This website which which provides the app code, tracks issues, and capture documentation like this one. Anyone can submit changes to the app code on this platform by making the change in their private code area and then requesting the change be "merged" into the code by making a "pull request".
Git This is a tool that keeps track of changes to the app code over time. This type of tool is called a "VCS" (Version Control System), and makes it easy to keep track of what changed, when, and makes reviewing and recovery simple. The code lives in a Git "repo", which is a directory containing all of the code

Accessing and building the app

To make changes to the app or simply to build and run the app from the source code, following the steps below.

  1. "Fork" the repo if you plan to contribute changes
    • "Forking" the app makes a copy of the repo under your GitHub account, where you can make any changes you need
  2. Download and install Android Studio
  3. Import the project into Android Studio
  4. Build and run the app

Contributing changes to the app

To contribute changes to the app:

  1. Make the change in your local repo on your computer
  2. "Commit" and "Push" the updates to your forked repo on GitHub
  3. Make a "Pull Request", to request the changes be reviewed for inclusion

Adding a new type of coin

To add a new type of coin to the app, following the steps below:

  1. Create the new coin class
    • Create a new class file in src/main/java/com/spencerpages/collections/
    • The new class should extend CollectionInfo, and implement all required methods
    • See other coin classes for examples
    • Make sure to update info such as start date, end date, mints, and years
  2. Add the new class to the COLLECTION_TYPES list in MainApplication.java
  3. Add a unit test to ensure the correct number of coins are generated

Unit testing

We've created "unit tests" for the app, which tests small pieces of the app to ensure they work properly. These tests can be run via the command line, using the following command:

cd path/to/cloned/repo
./gradlew testAndroidDebugUnitTest

See these steps for command-line setup

Running lint

Running "lint" performs static code analysis to detect possible issues. To run lint, run the commands below:

cd path/to/cloned/repo
./gradlew lint

See these steps for command-line setup

Helpful Links

Publishing to Google Play Store

Follow these steps

Publishing to Amazon App Store

  1. Test app by uploading here
  2. Submit the new app version Follow these steps:
  3. Follow these steps to update an existing app

The "AndroidRelease" build variant is for release to the Android App Store and "AmazonRelease" build variant is for release to the Kindle App Store.