All articles

Technical

Configuring App Shortcuts for Android TWAs

August 30, 2026 · 7 min read

Modern Android users expect high levels of integration from installed applications. One key feature of the Android user interface is App Shortcuts. When a user long-presses an app icon on their home screen or launcher, a contextual menu appears. This menu allows them to jump directly into specific sections of the application. For web developers converting a Progressive Web App (PWA) to an Android package via a Trusted Web Activity (TWA), this functionality can be fully mapped from the Web App Manifest into the compiled APK or AAB binary.

Understanding Web App Manifest Shortcuts

The Web App Manifest specification includes a member named shortcuts. This property accepts an array of shortcut objects, each representing a deep link into a specific feature of the application. When Google Play compiles your PWA into an Android app package, build tools read this array and dynamically generate native Android shortcuts. This eliminates the need to write custom Kotlin or Java code to manage launcher interactions.

By providing direct entry points, you reduce friction for return users. For instance, an e-commerce PWA can offer direct links to the shopping cart, search page, or order history. A project management tool can expose links to create a new task or open the active workspace.

Configuring the Shortcuts Array

To enable this integration, you must declare the shortcuts array inside your PWA web app manifest file, which is typically named manifest.json. Each shortcut object inside the array supports several specific parameters that dictate how the shortcut behaves and appears to the user.

Required and Optional Properties

  • name: The text displayed to the user in the long-press launcher menu. Keep this value short and action-oriented.
  • short_name: An optional abbreviated version of the name, used by Android if space is highly constrained on the launcher layout.
  • url: The deep-link target URL. This must be within the scope of your PWA. It can contain query parameters for analytical tracking, such as source or medium identifiers.
  • icons: An array of icon objects defining the visual asset for the shortcut. These icons must follow standard image formatting and size constraints to display correctly on high-density displays.
  • description: A detailed description of the shortcut purpose, though this is primarily used for accessibility and is rarely rendered directly on Android launchers.

A Manifest Shortcuts Example

Below is a typical JSON snippet demonstrating how to configure three distinct shortcuts inside your manifest.json file:

{ "name": "My SaaS Application", "short_name": "SaaS App", "start_url": "/", "display": "standalone", "shortcuts": [ { "name": "Create New Task", "short_name": "New Task", "url": "/tasks/new?utm_source=android_shortcut", "icons": [ { "src": "/icons/shortcut-new-task-96x96.png", "sizes": "96x96", "type": "image/png" }, { "src": "/icons/shortcut-new-task-192x192.png", "sizes": "192x192", "type": "image/png" } ] }, { "name": "View Analytics Dashboard", "short_name": "Dashboard", "url": "/dashboard?utm_source=android_shortcut", "icons": [ { "src": "/icons/shortcut-dashboard-96x96.png", "sizes": "96x96", "type": "image/png" } ] } ] }

How Manifest Shortcuts Map to Android XML

During the generation of your signed APK or Google Play ready AAB, the build processor reads the manifest.json file and translates the web-based configuration into native Android resource structures. This translation aligns with standard Android development architecture.

Web App Manifest ParameterAndroid XML EquivalenceImplementation Notes
nameandroid:shortcutLongLabelUsed as the main descriptive text for the shortcut.
short_nameandroid:shortcutShortLabelFallback text displayed when space is restricted on older launchers.
urlandroid:data (within Intent)The deep link parsed by the TWA to open the correct Web URL in the secure container.
iconsandroid:iconCompiled into drawables inside the res folder of the APK.

The translation process builds an XML file typically named shortcuts.xml inside the res/xml directory of the generated Android project. The AndroidManifest.xml is then updated with metadata linking to this resource file. When your application installs on a device, the Android operating system detects this XML definition and automatically updates the launcher options.

Icon Guidelines and Specifications

For your app shortcuts to look sharp on modern Android devices, you must provide correctly sized PNG assets. Unlike standard web page icons, launcher shortcut icons must support high pixel densities. If the icons are too small or poorly formatted, Android may render them with unwanted blurring or pixelation, or fallback to your primary application icon.

Provide icons in multiple resolutions to cover different device screen densities. The standard recommended target sizes are:

  • 96x96 pixels: Targeted at medium-density (mdpi) and high-density (hdpi) screens.
  • 192x192 pixels: Designed for extra-high-density (xhdpi, xxhdpi) and ultra-high-density (xxxhdpi) displays.

Ensure the designs use transparent backgrounds and high-contrast, recognizable symbols. Android may also apply adaptive mask shapes (such as circles, squares, or squircles) to your shortcut icons, so ensure the critical parts of the icon design sit comfortably within the safe inner safe-zone of the image area.

Limitations and Platform Behaviour

While the Web App Manifest allows you to declare numerous shortcuts, Android enforces strict limits to maintain user interface design standards and prevent clutter on the launcher screen.

Maximum Shortcut Count

The Android operating system imposes a limit of four shortcuts per application. If your manifest.json file lists more than four shortcuts, only the first four declared inside the array will be parsed and loaded into the native Android application bundle. Any additional entries will be discarded during compilation or ignored by the launcher at runtime. It is best practice to prioritize your most critical, high-frequency user actions within the first three or four slots.

Static vs Dynamic Capabilities

Shortcuts generated from the Web App Manifest are static shortcuts. This means they are defined at compile-time when the TWA APK or AAB is built. Once the app is installed, these shortcuts cannot be dynamically updated without compiling and publishing an update to your app package on the Google Play Store. If your PWA relies on highly dynamic web states (for example, showing the name of the last viewed project), these static manifest-based shortcuts will not adapt on the fly. They will always point back to the hardcoded URLs specified during build compilation.

Testing Your TWA Shortcuts

Once you have configured manifest.json and run your build on PWAtoApp, download the signed APK to an Android test device or emulator running Android 7.1 or higher (the API level where shortcuts were first introduced). Install the APK via Android Debug Bridge (ADB) or a local installer, launch the app at least once to ensure the web manifest registers, and then long-press the launcher icon. The declared shortcuts should display immediately. Tap a shortcut to verify that the TWA container successfully opens the targeted deep-link URL without displaying any address bars or authentication errors.

Ready to ship your Android app?

Paste your PWA URL, get a signed APK and a Google Play ready AAB in minutes.

Build my app