Modern mobile data dictates new rules, and standard websites no longer always meet user needs for speed and convenience. Progressive Web Apps (PWA) technology has become a real bridge between web development and native platforms, allowing you to run functional applications right from the browser. For business owners and developers, this offers a unique opportunity to expand their presence in the ecosystem Android without the need to publish on Google Play.

The process of creating such a solution may seem complicated to a beginner, but in reality it only requires compliance with a few key technical standards. You don't need to learn complex languages โ€‹โ€‹like Kotlin or Java if you already know the basics of web design. It is enough to correctly configure the manifest files and maintenance scripts so that your resource can be installed on the home screen of a smartphone as a full-fledged app.

In this article we will analyze in detail each stage of transforming a regular website into a powerful PWA application. You will learn about the necessary security requirements, the structure of configuration files and debugging methods that guarantee stable operation of your product on devices running Android OS.

Technical requirements and environment preparation

Before you start writing code, you need to make sure that your project meets basic security and performance criteria. A fundamental requirement for any PWA to work is to have a secure connection HTTPS. Browsers, including Chrome on Android, block installation of applications if they run over an insecure HTTP protocol, with the exception of local test environments.

In addition, your web application must be responsive and display correctly on screens with different resolutions. The user interface must adapt to the vertical and horizontal orientation of the device without loss of functionality. Lack of adaptive layout is the most common reason for application rejection when verified by Google audit.

โš ๏ธ Attention: If you use third-party CDNs or connect resources from other domains, make sure that they also work over the HTTPS protocol. Mixed Content can break the Service Worker and make the application impossible to install.

You can use the built-in developer tools to check the readiness of your project. In the browser Chrome on your computer, open the DevTools panel, go to the Application tab and select the section Manifest. The system will automatically analyze the presence of all required fields and indicate errors if any.

๐Ÿ’ก

Use the Lighthouse tool in Chrome DevTools to get a full audit of your PWA. It will give a score in the categories of PWA, Performance, Accessibility and SEO, pointing out specific shortcomings.

Creating and customizing the Manifest.json file

The manifest file is the heart of your application, containing the metadata that the browser uses to set and display the icon on the desktop. This is a regular JSON file that must be linked to your HTML page through a special tag in the headsection. The correct configuration of this document determines how the application will look after installation on the user's device.

Inside the file, you must specify several required parameters, such as the short and full name of the application, start page and display mode. Parameter display plays a critical role: value standalone hides the browser address bar, creating the effect of a native application, while minimal-ui leaves a minimal navigation interface.

  • ๐Ÿ“ฑ name i short_name: The full name is displayed during installation, and the short one is under the icon on the desktop.
  • ๐ŸŽจ icons: An array of images various sizes (minimum 192x192 and 512x512 pixels) in PNG format.
  • ๐Ÿš€ start_url: The address of the page that opens when you launch the application from the desktop.
  • ๐Ÿ”’ theme_color: The color of the Android taskbar, which gives the interface integrity.

After creating the file, do not forget to connect it to the main document of your site. Paste the following line of code into the header of each page you want to make available in app mode:

<link rel="manifest" href="/manifest.json">

It's also important to add a meta tag to support older versions of iOS Safari, although our main goal is Android. This will ensure cross-browser compatibility and correct display of the status bar color on Apple devices if you decide to scale up in the future.

โ˜‘๏ธ Checking the manifest

Done: 0 / 5

Implementation of Service Worker for offline operation

Service Worker is a JavaScript script that runs in the background, separate from the web page, and acts as a network proxy. It is this component that is responsible for the ability of the application to work without an Internet connection, caching resources and sending push notifications. Without an active Service Worker, your application cannot be considered a full-fledged PWA.

The script registration process occurs in the main JavaScript file of your site. You need to check your browser's technology support and then register the service-worker.js file in the root directory of your domain.

if ('serviceWorker' in navigator) {

window.addEventListener('load', () => {

navigator.serviceWorker.register('/service-worker.js')

.then(reg => console.log('SW registered:', reg))

.catch(err => console.log('SW registration failed:', err));

});

}

Inside the Service Worker file itself, you must implement the logic for processing events such as install, activate and fetch. The setup phase typically caches static resources (CSS, JS, images), and the fetch event intercepts network requests and returns data from the cache if the network is unavailable.

โš ๏ธ Note: Service Worker only works on pages served over HTTPS. When developing locally, you can use localhost, but when outputting to a production server, a certificate is required.

There are several caching strategies that can be used depending on the type of content. The strategy Cache First is ideal for static files, while Network First is better suited for dynamic data that must always be up to date. Choosing the right strategy directly affects download speed and traffic consumption.

What to do when updating Service Worker?

When you change the Service Worker code, the browser will install the new version in parallel with the old one. The new version will become active only after all tabs with the old version are closed. To force an update, you can use the skipWaiting() method.

Adding icons and visual design

The visual component plays a decisive role in the user's perception of the application. The PWA icon should be clear, recognizable and comply with design guidelines Material Design. Unlike regular favicons, manifest icons should be square with no transparency (or the fact that Android can add its own background) to look good in any desktop environment.

It is recommended to prepare a set of images in multiple resolutions to ensure high-quality display on screens with different pixel densities (DPI). The minimum set should include images measuring 192x192 pixels for the desktop and 512x512 pixels for the loading screen (splash screen).

Size (px) Purpose Format Features
192x192 Icon on the desktop PNG Main size for Android
512x512 Loading screen / Splash PNG Used when launching the application
96x96 Notifications PNG To be displayed in notification curtain
72x72 Old devices PNG Support for legacy smartphones

In addition to icons, do not forget to customize the theme color and background color. These settings determine the appearance of the Android taskbar and screen that the user sees while the app is loading, before the first frame is rendered. The harmonious combination of these colors creates a feeling of nativeness and completeness of the product.

๐Ÿ“Š What icon size do you use most often?
192x192
512x512
1024x1024
SVG vector

Testing and debugging on real devices

Emulators and developer tools in desktop browser are useful in the initial stages, but nothing can replace testing on a real device running Android. The behavior of the browser Chrome on the phone may differ from the desktop version, especially in matters of memory management and background Service Worker processes.

For remote debugging, connect your smartphone to the computer via a USB cable and activate USB debugging mode in the phone developer settings. In desktop Chrome, go to chrome://inspect/#deviceswhere you will see your connected device and open tabs. This will allow you to use the full arsenal of DevTools for element inspection, network analysis and JavaScript debugging right on your phone.

Pay special attention to the behavior of the application when switching to offline mode. Disable the network in your phone settings or through DevTools and check if the content is loading from the cache. Also test the scenario of adding to the home screen: does a pop-up offer appear (install prompt) or does the user have to add a shortcut manually through the menu.

  • ๐Ÿ” Check the navigation to see if all links open within the application, and not in an external browser.
  • โšก Evaluate loading speed: the first opening should be fast even on a slow connection.
  • ๐Ÿ“ฒ Test gestures: swipes and taps should respond instantly, without delay.

If the application does not offer installation, check the console for Service Worker registration errors or validation issues manifesto. Often the cause is an incorrect file path or missing required fields in the configuration.

๐Ÿ’ก

Successful testing on a real device is the only way to ensure that users get a quality experience using your PWA.

Publishing and distributing PWAs

One โ€‹โ€‹of the main advantages of PWA technology is that it is not strictly tied to app stores. You can distribute your application simply by sending users a link to your site. However, to increase trust and ease of access, it is recommended to add the site to Google Play through technology Trusted Web Activity (TWA).

TWA allows you to wrap your PWA in a lightweight native shell and publish it in the store. To do this, you can use a tool Bubblewrap from Google, which generates an Android Studio project based on your manifest. This makes it possible to receive user reviews in the Play Store and improve positions in the store's search results.

โš ๏ธ Attention: App store policies and security requirements are constantly updated. Before publishing, be sure to check the latest Google Play Developer Documents as TWA eligibility rules may change.

Even without publishing to the store, you can encourage installs by implementing a custom banner within your site. Using JavaScript, you can track the event beforeinstallprompt and show the user a nice "Install app" button that initiates a standard browser install dialog.

In conclusion, creating a PWA for Android is an investment in the accessibility and performance of your digital product. By following the steps described, you will provide users with quick access to your service, regardless of the quality of their Internet connection.

Is it possible to update PWA in the Play Store?

Yes, when using TWA, content updates occur automatically through the Service Worker, but updating the shell itself (for example, the Android API version) will require uploading a new version of the APK to the developer console.

Do you need knowledge of Java or Kotlin to create a PWA?

No, to create a basic PWA, knowledge of HTML, CSS and JavaScript is enough. Native languages are only required if you decide to wrap your app in TWA for publishing on Google Play, but even there you can use ready-made tools like Bubblewrap, minimizing manual coding.

Do Push Notifications on iOS work for PWAs?

Currently, support for Push Notifications for web apps on iOS is limited and unstable compared to Android. On Apple devices, this function is available only in the latest versions of iOS and requires additional settings, while on Android it works natively and stably.

How to update the user's PWA version?

The update occurs automatically. When the browser detects changes to the Service Worker file, it downloads the new version in the background. Activation of the new version occurs after reloading the page or closing all tabs with the application.

Is it possible to monetize a PWA application?

Yes, you can use any web technologies for monetization: advertising networks (Google AdSense), paid subscriptions via Stripe or PayPal, as well as in-app purchases if you use the Digital Goods API.