All articles

Technical

Mapping Web App Manifest Fields to Android XML

August 25, 2026 · 6 min read

When converting a Progressive Web App into a native Android package via a Trusted Web Activity (TWA), developers often wonder how their web configurations translate into Android binaries. The bridge between the web and Android environments is the translation of your web app manifest to the Android Manifest XML file.

Understanding this mapping is essential for styling your app, managing launch behaviour, setting orientations, and ensuring a seamless transition from web page to native shell. While a PWA generator automates much of this conversion, understanding which web manifest fields map to native properties allows you to fine-tune your app store listing and build process.

The Core Mapping Architecture

Your web app manifest contains metadata that browsers use to install and render the PWA on desktop and mobile operating systems. When packaging this PWA for Google Play using a TWA, a compilation tool reads this JSON file and uses its values to populate both AndroidManifest.xml and the build resources.

Web Manifest KeyAndroid Manifest Property / Resource LocationFunction in Android App
name@string/app_nameThe app name shown in the launcher, app info, and installer.
short_name@string/launcher_nameThe name displayed under the application icon on the home screen.
theme_colorwindowColorRound / colorPrimaryThe colour of the Android status bar and system task switcher bar.
background_color@color/background_colorThe background colour of the native splash screen during boot.
orientationandroid:screenOrientationLocks the native orientation of the TWA wrapper activity.
displayNative display mode flags (Fullscreen vs Normal)Determines if system navigation bars remain visible.
shortcuts@xml/shortcutsContextual action shortcuts accessible by long-pressing the app icon.

Deep Dive: App Names and Labels

The web app manifest defines two distinct naming parameters: name and short_name. The Android OS uses these fields in different interfaces.

The name property represents the complete, formal name of your application. During the packaging process, this value is compiled into the app resources as the primary application label. It is displayed in the Google Play Store, on the Android system settings app management screens, and during the initial installation prompt.

The short_name property is a compressed version of your title, designed to prevent truncation on device home screens. In the Android translation process, this translates to the launcher name. If your web manifest lacks a short_name, the compiler falls back to using the standard name field, which may result in visual clipping if the title exceeds twelve characters.

Theme and Background Colour Mapping

Color definitions in your JSON manifest dictate how the operating system frames your web content before the web page itself has finished loading.

The theme_color value sets the colour of the Android status bar at the top of the viewport. When the TWA launches, the native wrapper reads this colour and immediately tints the status bar to match, maintaining visual consistency while Chrome initializes. Once the web content loads, the service worker and web runtime take control, but the initial transition is governed entirely by the compiled native resources.

The background_color property dictates the native splash screen background. Because there is a brief latency period between clicking the app icon and rendering the actual web page, the TWA wrapper displays a native splash screen. The compiler extracts this background colour to fill the screen canvas behind your app logo, preventing a stark white flash on launch, which is critical for dark-themed applications.

Icon Conversion and Adaptive Assets

On the web, PWAs list an array of image files in various sizes. Android, however, requires specific icon formats structured inside resource directories.

  • Launcher Icons: The compiler scans the icons array for the highest-resolution square icons to generate the legacy launcher assets.
  • Adaptive Icons: Android 8.0 and higher uses adaptive icons consisting of a background and a foreground layer. PWA manifests support this through the purpose: "maskable" attribute. Icons marked as maskable are separated into appropriate safe zones to ensure they render correctly within circular, square, or teardrop frames on different OEM devices.
  • Monochrome Icons: Icons specified with purpose: "monochrome" are mapped to Android notification bar icons, ensuring system-level status notifications conform to Android design patterns.

Display Modes and Orientation Restrictions

The display property determines how much browser chrome remains visible to the user. When converting to a TWA, this setting is hardcoded into the wrapper's main activity style parameters.

If the web manifest declares display: standalone or display: minimal-ui, the TWA activity will display the web content in a full-screen container while keeping the native Android status bar and navigation bar visible. If you select display: fullscreen, the native wrapper configures the activity to use the system immersive mode, hiding both status and navigation bars until the user swipes from the edge of the screen.

The orientation property restricts how the app reacts to device rotation. When set to portrait or landscape in the web manifest, the build process injects the android:screenOrientation="portrait" or android:screenOrientation="landscape" attribute directly into the AndroidManifest.xml. If this field is omitted or set to any, the system allows standard screen rotation based on physical sensor inputs.

Translating Web App Shortcuts

The shortcuts key in a web manifest provides quick navigation links to specific parts of your application. Android supports this capability natively through launcher shortcuts, which are revealed when a user long-presses your app icon on the home screen.

During compilation, the builder reads the shortcuts array and generates an XML resource file. This XML registers the shortcut intent filters with the Android OS. When clicked, the shortcut launches the TWA directly to the specified target URL instead of the default start URL, carrying over the intent extras to bypass the standard home route.

Keeping Web and Android Manifests in Sync

Because the web manifest is read at build time, runtime changes to your web host's JSON manifest will not dynamically alter the native elements of your installed Android app. While changes to your web application's CSS, JavaScript, and dynamic page layouts will update instantly on user devices due to the web-based nature of TWAs, core structural elements like launcher icons, the splash screen background color, and locked screen orientations require a rebuild and redistributing a new AAB to the Google Play Store if you alter them on your server.

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