How FadCam App Shortcuts Are Integrated with MacroDroid: Complete Technical Guide

FadCam exposes dynamic Android App Shortcuts through the ShortcutsManager class that publish explicit intents for actions like start/stop recording, which MacroDroid can trigger either through automatic discovery or manual intent configuration.

FadCam is an open-source Android camera application designed with automation in mind. According to the anonfaded/FadCam repository, the app leverages Android's ShortcutManagerCompat API to publish dynamic shortcuts that third-party automation tools like MacroDroid can discover and invoke without requiring root access or special permissions.

How FadCam Publishes Dynamic Shortcuts for MacroDroid

Shortcut Registration in ShortcutsManager

In app/src/main/java/com/fadcam/shortcuts/ShortcutsManager.java, the publishAllDynamic() method (lines 79-102) constructs ShortcutInfoCompat objects for each supported action. The manager defines distinct IDs such as ID_START, ID_STOP, ID_TORCH, and ID_SHOT, building each shortcut with a specific target Intent and drawable resource.

These shortcuts are published to the system via ShortcutManagerCompat.setDynamicShortcuts(), making them immediately available to any automation app that queries the device's shortcut inventory. Because the shortcuts are dynamic rather than static, they refresh automatically when users modify labels or icons through the settings UI.

Intent Targets and Activity Mapping

Each shortcut maps to a concrete launcher Activity that performs the requested action. For example, the Start Recording shortcut targets RecordingStartActivity located in app/src/main/java/com/fadcam/RecordingStartActivity.java (lines 13-34).

The Intent construction follows this pattern:

Intent intent = new Intent(Intent.ACTION_VIEW)
    .setClassName(context, "com.fadcam.RecordingStartActivity")
    .putExtra("shortcut_camera_mode", "back");

When RecordingStartActivity receives this intent, it reads the shortcut_camera_mode extra (lines 36-50) to determine whether to initialize the front or back camera, then starts the RecordingService directly without launching the main FadCam interface.

Mapping FadCam Shortcuts in MacroDroid

Automatic Discovery via Launch App

MacroDroid can discover FadCam's shortcuts natively because they are published through the standard Android Shortcuts API. To configure:

  1. Create a new Macro in MacroDroid
  2. Add the Launch App action
  3. Select FadCam from the app list
  4. MacroDroid displays the available shortcuts (Start Recording, Stop Recording, Toggle Torch, Take Photo)
  5. Select the desired shortcut and assign a trigger (e.g., Volume Up button)

When the trigger fires, MacroDroid constructs and sends the exact same explicit Intent defined in ShortcutsManager, targeting the appropriate Activity for the selected action.

Manual Intent Execution

For advanced scenarios requiring custom extras (such as forcing the front camera), use MacroDroid's Execute Intent action with these parameters:

Parameter Value
Action android.intent.action.VIEW
Package com.fadcam
Class com.fadcam.RecordingStartActivity
Extra Key shortcut_camera_mode
Extra Value front (or back)

This generates the explicit intent:

Intent intent = new Intent(Intent.ACTION_VIEW)
    .setClassName("com.fadcam", "com.fadcam.RecordingStartActivity")
    .putExtra("shortcut_camera_mode", "front");

As noted in app/src/main/res/values/strings.xml (line 842), these shortcuts "also work with automation apps (e.g., MacroDroid) to trigger actions like mapping volume buttons."

Customizing Shortcuts for Automation Workflows

Modifying Shortcut Properties

The ShortcutsSettingsFragment in app/src/main/java/com/fadcam/ui/ShortcutsSettingsFragment.java (lines 67-102) provides the UI for customizing shortcut labels and icons. When users modify these properties through the method wireShortcutRow(), the ShortcutsManager republishes the dynamic shortcuts, ensuring MacroDroid always sees the current configuration without requiring manual updates in the automation app.

Adding New Automation Hooks

Developers extending FadCam can expose new actions to MacroDroid by adding entries to publishAllDynamic() in ShortcutsManager.java:

list.add(
    buildShortcut(
        "custom_action_id",
        new Intent(Intent.ACTION_VIEW)
            .setClassName(ctx, "com.fadcam.CustomActionActivity"),
        R.drawable.custom_icon,
        ctx.getString(R.string.custom_label)
    )
);

After installing the modified APK, MacroDroid automatically lists the new shortcut among discoverable actions.

Summary

  • Dynamic shortcut registration occurs in ShortcutsManager.java via ShortcutManagerCompat.setDynamicShortcuts(), exposing actions like ID_START and ID_STOP
  • Explicit intent targets such as RecordingStartActivity handle shortcut requests without launching the main UI
  • MacroDroid integration works through either automatic shortcut discovery or manual Execute Intent configuration using standard ACTION_VIEW
  • Camera selection is controlled via the shortcut_camera_mode extra passed to target activities
  • No root access required because shortcuts use standard Android intent resolution with exported activities

Frequently Asked Questions

Can MacroDroid start FadCam recording without opening the app interface?

Yes. When MacroDroid triggers the Start Recording shortcut, RecordingStartActivity receives the intent, initializes the RecordingService with the specified camera mode, and calls finish() immediately. This starts recording in the background without displaying the FadCam UI.

Which shortcut IDs are available for automation in FadCam?

The source code defines several IDs in ShortcutsManager.java: ID_START for recording initiation, ID_STOP for ending sessions, ID_TORCH for flashlight control, and ID_SHOT for still photography. Each maps to a specific launcher Activity that handles the request.

How does FadCam determine which camera to use when triggered by MacroDroid?

RecordingStartActivity checks the shortcut_camera_mode string extra from the incoming intent (lines 36-50). Valid values are "front" or "back". If the extra is missing, the activity defaults to the back camera configuration defined in the ShortcutsManager shortcut definition.

Do I need special permissions to automate FadCam with MacroDroid?

No. Because FadCam's shortcuts use explicit Intents with ACTION_VIEW targeting exported Activities (which serve as entry points for shortcuts), MacroDroid can trigger them without requiring ROOT access, device admin privileges, or accessibility services.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →