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
common
module inbuild.gradle
dependencies of your module:implementation project(':common')
. -
Create a
Fragment
for your application. -
Create a navigation graph in
src/main/res/navigation
and define yourFragment
as a start destination. Make sure to use a unique name for your navigation graph file to prevent collisions with other apps. -
Create your own
Activity
extendingBaseActivity
, and overridenavigationGraph
to be the ID of your navigation graph, and optionallybottomNavigationMenu
to 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.gradle
dependencies, wheremy-app
is the name of your module. -
Define your
Activity
inapp/src/main/AndroidManifest.xml
. -
Define your app in
AppDefinition
enum inapp/src/main/java/nl/tudelft/trustchain/app/AppDefinition.kt
. You should specify the icon drawable resource, app name, color, and yourActivity
class. -
Install the super app and check that your app is available in the dashboard and can be opened on click:
./gradlew :app:installDebug