Application or web? Both in one with PWA

Leturia Azkarate, Igor

Informatikaria eta ikertzailea

Elhuyar Hizkuntza eta Teknologia

The debate has long been coming on whether applications or websites are better for mobile devices. Both have advantages and drawbacks, so there is no clear answer, but it can be said that in general applications have prevailed in recent years. Now, however, there is a new technology that brings together the best features of both and that can fulfill its functions without having the disadvantages of each of them: Progressive Web App or PWA technology.
aplikazioa-edo-webgunea-biak-batean-pwarekin
Ed. Dijoantonycj/CC-BY-SA

Since mobile devices have internet it is possible to surf the web with them. However, at present almost any organization or company that has a web page or a web service has developed an application to make available to users the services or contents that also exist on the web. However, there are those who think that this is not the way to go.

As we mentioned in an article written in this section in 2011, the websites have certain advantages: on the one hand, all of them use protocols and open standards; on the other, they make a unique website that will work on any device with Android, iOS or operating system.

Those who defend applications also have their arguments. One of them is that a web can't do things an application can do. Although HTML 5 and similar technologies allow websites to do more and more things, there are still things they can't do: show notifications outside the browser, even though we're offline the initial quick opening…

Who is right? The truth is that everyone. It is undeniable that the Webs cannot do some things that the Apps can do and that is why they have been successful, although it is necessary to make a version for each of the main operating systems. In any case, in addition to the applications, it is necessary to create a web page for the public that accesses from the computer.

Webs that look like applications

Precisely, almost two years ago, Google proposed the Progressive Web App or PWA technology with the aim of solving the drawbacks of websites on mobile versus applications. In his opinion, the objective was “to obtain a user experience of application with websites”. In short, this technology consists of adding to the browsers certain characteristics so that they can be used by the websites. In this way, the possibilities offered by mobile devices can be better exploited.

The so-called Service workers are one of the main features of PWA technology. They are fragments of Javascript code that are executed in the background or in the back. One of the things you can do is, for example, download and store in the local the data that our website needs when we have internet connection. Thus, the website, even if it does not have an Internet connection, can function as if it had it, that is, it would allow it to walk offline.

In addition, we can determine which contents make up the skeleton or fixed content of the web, the service worker will keep it in the local and so, on the following occasions, the web will open quickly as the applications. And through these service workers you can get notifications out of the web to be displayed on the device, as the applications do.

The PWA are also installable. If we enter for the second time on a website that uses this technology and have spent more than 5 minutes from the previous one (don't wonder why that time! ), will allow us to install it and, if yes, on the desktop will be placed an icon like that of any other application.

Therefore, a website that uses PWA technology can do almost everything an application can do. But it also has advantages that applications do not have. On the one hand it is linkable, since as any web has a URL and any page within it. On the other hand, search engines can index it and detect it as an installable application. In addition, they can be installed without going through the app store. And finally, the only development is enough to have a web and an application that works on any device.

There are several successful cases of PWA technology. Some of them can be seen in https://pwa.rocks/. For example, the well-known Telegram messaging system has a PWA that can be run on both the computer and the web, as well as the services of the custom magazine Flipboard. And India's Flipkart and Alibaba and China's AliExpress online stores claim that accelerating speeds by converting the web to PWA technology has brought them great fidelity and increased sales.

It is foreseeable that more and more PWA websites are being expanded and that little by little they all pass to it. The problem is that not all browsers are implementing PWA technologies. Browsers that are free software or that follow open protocols and standards have been implemented or are in it (Firefox, Chrome and Opera), but Apple and Microsoft don't, anyone knows why. Well, surely it will be the technology proposed by Google, the competitions. In the case of Apple, another major reason is that PWA can be installed without going through the store. Apple is known to charge a percentage for each application that is purchased and installed through its store. In any case, converting a website to PWA does not mean that it does not work in Explorer, Edgen, iPhone or Safari, the truth is that in them you will not be able to benefit from the advantages of PWA.

So, there are no excuses for our website not to become PWA: at least, the web will work faster on Android and on computers, and for Android we will not have to develop any applications, and if we want, we will only have to make the app for iOS or Windows phones, and hopefully if Microsoft and Apple change their attitude in the future will not. Unique PWA to govern all!

Babesleak
Eusko Jaurlaritzako Industria, Merkataritza eta Turismo Saila