HowToAddNewTransitAgencyModule - mtransitapps/mtransit-for-android GitHub Wiki

How to add new transit agency module (WIP)

Last Update: 2025-04-03

  • Pick project directory ID:

2 letter country code + city/area name + agency name + transport mode (ca-city-transit-agency-bus)

  • (Alternative: use an existing module repo code as a template/starting point)
  • Create new git repository https://github.com/mtransitapps/ca-city-transit-agency-bus-android with default branch master (default for mtransitapps org)
gh repo create mtransitapps/ca-city-transit-agency-bus-android --public
git clone [email protected]:mtransitapps/ca-city-transit-agency-bus-gradle.git
  • Create mmathieum branch (TO BE DEPRECATED LATER)
git checkout -b mmathieum
  • Add a config directory with the necessary files
    • agency_name: all valid agency names from short to long (TO BE OPTIONAL LATER)
    • cities: static list of cities deserved by the agency (TO BE GENERATED LATER)
    • input_url: GTFS static url
    • parent_agency_name: (optional) all valid parent agency names from short to long
    • pkg: package name for Google Play Store like org.mtransit.android.ca_city_transit_agency_bus
    • source_url: web page URL where the GTFS static feed is shared
    • state: (optional) state/territories/provinces names from short to long
    • gtfs:
      • agency.json: JSON file containing agency settings
        • target_route_type_id: route type interger from GTFS Static routes.route_type
        • default_strings_cleaner_enabled: default string cleaner enabled/disabled (based on language/country/field)
        • default_color_enabled: default color enabled/disabled for agency (based on routes colors)
        • default_color: default color if not extracted from routes colors
        • default_color_comment: description of the source of the default color
      • route.json: JSON file containing route settings
        • default_route_id_enabled: default route ID number generated from routes.route_id string
        • use_route_short_name_for_route_id: generate route ID number from routes.route_short_name instead of routes.route_id
        • route_id_cleanup_regex: regex to clean route_id so it's more stable accross schedule changes
        • route_colors.[route_short_name,color]: arraw of route color provided when missing
        • direction_finder_enabled: turn on direction string finder from trips.trip_headsign...
    • store:
      • alpha: empty file presence indicating to automation that this module is available in alpha channel
      • beta-private: empty file presence indicating to automation that this module is available in Beta (Private) channel
      • production: empty file presence indicating to automation that this module is available in Production channel
  • Add an app-android directory with the necessary files
    • src/main/res/values/
      • gtfs_rts_values.xml: GTFS static settings
      • gtfs_rts_values_gen.xml: GTFS static settings (generated)
      • gtfs_real_time_values.xml: GTFS Real-Time settings
      • rss_values.xml: RSS settings
      • twitter_values.xml: Twitter/X settings
      • youtube_values.xml: YouTube settings
  • Init repo with code_setup.sh from commons repo in another directory (WIP)
../other_directory/commons/code_setup.sh
  • ... (WIP)
  • trigger MT sync code & data workflow to sync latest code (+generate) & download & parse latest static data
  • ... (WIP)
  • Create new app on Google Play Console
    • Test and release
      • Setup
        • App Signing: do NOT use Play App Signing, instead re-use signing key from main "MonTransit" app
      • Production
        • Countries/regions: target All countries/regions
      • Testing
        • Closed testing:
          • Alpha > Manage track
            • Testers:
              • Email lists: MonTransit Alpha & MonTransit Team
          • Create track with name Beta (Private):
            • Testers:
              • Google Groups: [email protected]
              • Feedback URL https://groups.google.com/g/montransit-beta
    • ... (WIP)
  • Update wiki/BETA
  • Download the app from the Play Store (Alpha/Beta channel)
  • Using Play Store main app, create & upload new screenshots on Play Store (& git)
  • Publish to Production
  • Update main app discovery: modules.json & bump version ModuleDbHelper.DB_VERSION
  • Update wiki/Apps