Skip to content

2 Dev Wiki

EwasWorld edited this page May 24, 2021 · 11 revisions

Table of Contents

Development Process

  1. Add any required database/Room changes and create database tests where possible
  2. Create the back end elements and unit test them (ensures that the logic is unit testable)
  3. Create the front end elements and add instrumented tests

If you get stuck on something for more than a couple of hours, find any kind of work around possible (even if it's the dirtiest most disgusting code) then create a Trello card to come back to it in the future. Better to move on and come back when you know a bit more than get stuck on making something perfect.

Dev Environment

  • SDK
  • Recommended to use Android Studio 4.2+ (displays previews of FragmentContainerViews in XML layouts)

Architecture

  • Fragments (can use Activity instead of FragmentActivity as API level is >= 11)
    • In API levels 4-16 <meta-data> can be used to declare the parent activity. From 16 onwards, android:parentActivityName is used. Source
    • Fragments vs Activities quick overview (Aug 2020)
    • Skip a fragment in the backstack by adding an app:popUpTo property to the <action> in the navigation resource

Database

  • Firebase - online database (to investigate)

Current DB Structure

database class diagram

  • This model offers no way to store a field round.
  • For free scoring (scoring without selecting a round), there will be the option to select a distance, face size, and arrow count (not required).
  • In the archerRounds table
    • Either roundRefId or freeScoreId must be used
    • countsTowardsHandicap defaults to no
    • goalScore and shootStatus are optional
  • scoringType (roundsRef), shootStatus(archerRounds), and bowStyle (bows) are all relatively fixed values though users may want to input their own values. Could leave it as a string or change it to reference a separate, immutable table

Testing

  • Before/AfterClass etc
  • Error when running instrumented test java.lang.TypeNotPresentException: Type androidx.test.ext.junit.runners.AndroidJUnit4 not present. Android Studio is treating this as an instrumented test. Delete the Run Configuration. Stack Overflow

Dagger

Database testing

Debugging

  • Logging: easiest way to check the logs is to plug the phone in (make sure Android Studio recognises it and can run on it). AS will display the log in the Logcat tab even if the app isn't running under Android Studio. If you need more than this check out adb which is under sdk/platform-tools and seems to do logcat and more

Misc