You can follow these steps to add a new module to the super app. You can also duplicate an existing module (e.g., debug) and update it according to your needs. However, make sure you still perform the required changes according to this guide.
-
Create a new Android library module (
File-New-New Module...-Android Library). -
Define the dependency on
commonmodule inbuild.gradledependencies of your module:implementation project(':common'). -
Create a
Fragmentfor your application. -
Create a navigation graph in
src/main/res/navigationand define yourFragmentas a start destination. Make sure to use a unique name for your navigation graph file to prevent collisions with other apps. -
Create your own
ActivityextendingBaseActivity, and overridenavigationGraphto be the ID of your navigation graph, and optionallybottomNavigationMenuto return the menu ID to be used for the bottom navigation. -
Define dependency of the super app on your app module by adding
implementation project(':my-app')toapp/build.gradledependencies, wheremy-appis the name of your module. -
Define your
Activityinapp/src/main/AndroidManifest.xml. -
Define your app in
AppDefinitionenum inapp/src/main/java/nl/tudelft/trustchain/app/AppDefinition.kt. You should specify the icon drawable resource, app name, color, and yourActivityclass. -
Install the super app and check that your app is available in the dashboard and can be opened on click:
./gradlew :app:installDebug