dimanche 22 janvier 2017

Deeply Integrated Progressive Web Apps (WebAPKs) are Live for Chrome on Android

For most of Android's history, applications have been installed as local packages on the device itself. We typically acquire the installation files we need by downloading an APK file, which is an archive containing all of an application's resources and assets. While there are many benefits to installing a native application this way, there are also many benefits to developing an application that is web based. Web applications can be accessed on multiple platforms, can be easily modified, and can be readily deployed among other benefits.

Google has taken web apps one step further and created Progressive Web Apps (PWA), which are more integrated with mobile devices. Progressive Web Apps have access to send push notifications and most importantly are "installed" to the home screen of a device. These web apps can be created from most websites by clicking the "Add to Home Screen" option in Chrome's menu, however, how functional the Progressive Web App actually is depends on website support.

One of the major downsides of PWA are that they are not treated as actual applications on the device. As these web apps are accessed via home screen shortcuts, many users who like to theme their home screens are probably put off by this fact. I can speak from experience. Fortunately, during the 2016 Chrome Dev Summit last November, the Chrome team demonstrated that Progressive Web Apps could actually be turned into APKs that would install on your device.

The developer team did not state when exactly support for "WebAPKs" would go live, but apparently it is already live – it's just nobody really noticed. To be fair, the only way to enable support for this feature is to enable a new Chrome flag:

  chrome://flags/#enable-improved-a2hs  

If you paste the above link into your address bar (while on either the Dev or Canary channels of Chrome for Android), then you will be taken to a Chrome flag which states the following:

Enable improved add to Home screen.

Android Packages "Progressive Web Apps" so that they can integrate more deeply with Android. A Chrome server is used to package sites. In Chrome Canary and Chrome Dev, this requires "Untrusted sources" to be enabled in Android security settings.

As is clearly stated, Progressive Web Apps can now be packaged into actual installable Android packages! This uses a back end Chrome server to package the website into an APK (though it is unclear if it is Google running this server, which presume is the case). Once you enable the flag and restart Chrome, any PWA you "Install to Home Screen" will instead download an APK file to install on your device. Not every website supports this, of course, but you can take a look at the websites that fully support this new feature right here.


Fun with Progressive Web Apps

We've taken two different PWAs for a spin to see how the feature fares – Financial Times and Telegram. Financial Times is a simple news website which is the perfect case of a time when the mobile website might be a better choice than a separate application.

As you can see, the PWA is treated like an actual application by Android. It prompts you to be installed and it resides within the app drawer like any other app. Furthermore, removing the PWA works just like uninstalling any other app.

Note the difference in the information bar in these two screenshots showing the recent apps screen. The first screenshot is what happens when you "install" a PWA without this new flag enabled, while the second screenshots shows a true installation of the PWA with the flag enabled. Financial Times exists as an application on my phone which can be dismissed separately from other Chrome tabs.

Next up is the Telegram web app. This PWA uses Telegram's web interface to serve you messages. To be honest, Telegram is probably one of the best designed and functioning applications that exists on Android, so I personally don't see the need for this PWA. However, I wanted to test the functionality of an instant messenger that was installed as a PWA so I decided to give it a spin.

While Telegram does indeed install and display all of my messages appropriately, there was one major caveat: notifications. It appears that notifications are not functioning properly right now. When I sent Mario Serrafero a message over Telegram, he did receive a notification (as shown in the bottom left screenshot) but it did not contain any useful information. Opening the "Site Settings" option brought us to the site specific settings for the Telegram web app which showed that Notifications were enabled, so we aren't sure why notifications do not work.

Of course, since the flag to enable WebAPK installations only exists in the Dev and Canary channels on Chrome for Android, we are assuming that this feature is a WIP and thus not everything will work at this time. Since we know that Chrome is able to send push notifications (for instance on Facebook), it is possible that Progressive Web Apps installed this way may also be able to receive push notifications in the near future.


Otherwise, this is a neat look into an experimental feature that I hope becomes more robust as time goes on. I like using Web Apps personally as they tend to serve me the information I need without any bells and whistles that tend to lag the device or drain my battery. Furthermore, this approach solves one of my major qualms with web apps, that being the fact that they were required to stay on your home screen in order to be launched. With web wrappers of various popular sites becoming more and more common, hopefully we'll see more companies adopt the Progressive Web App standard.



from xda-developers http://ift.tt/2k46ZHh
via IFTTT

Aucun commentaire:

Enregistrer un commentaire