Thursday, 17 September 2015

How to make a hosted web app listed in app stores and installable for the end users

Building a hosted web app has many advantages. One advantage is that it is not necessary to create big software packages containing the whole app where the users will have to download and install. It is only necessary for them to open the main page of the app and work with it. Also the app may be updated whenever it is necessary and the end users receive the update in real time.
Hosted apps do not require to be placed in an app store and follow certain specifications on the way they are built. Just find a host which may be free, paid or the server of your company and put your creation in there.
There is a small down side in this practice. Apps that require installation create a stronger bind to the end users while hosted apps have a more loose attachment to their users. Also, apps that are listed in an app store receive some promotion just by being there; they may be searched and found easier.
The good news are that there are three app stores that list hosted web apps and two of them provide some methods of installing a link or a small app pointing to your hosted app in the end user's computer.
I had to discover all these things I write about in this post after I finished developing WMS Viewer on line. It is a web app and it was really easier to develop it than to find out what to do with it afterwards.
An easy choice for listing your app is the Opera Mobile Store. The store lists apps mainly for mobile devices (new, old and very old) but also accepts submissions for HTML5 web apps for desktop computers. The submission procedure is similar to any other app store. The submitted apps are being reviewed before publication (which I find a good idea) and usually it doesn’t take more than one or two days. When you click on a web app you view its store listing and there is a download button which simply opens the homepage of your app. See my listing for example.
The other two app stores are the Chrome Web Store and the Firefox Marketplace. Both stores address to certain browsers and they both share an interesting feature. When a user downloads an app from these stores the app (or at least a link) gets installed on the user’s computer.
In Chrome Web Store you have to pay a onetime fee (like in Play Store) this fee is currently 5$ and you may place up to 20 apps. Then you have to confirm that the web page you submit is yours by logging in to Google web masters and put a metadata file in the root directory of your app. You can do the submission procedure with any browser but the apps are available for download only in Chrome.
During submission it is only necessary for you to provide a .json type manifest file, a description of the app and some screenshots. But as the store accepts submissions of apps, themes and extensions for Chrome with the same procedure, you have to be very careful and submit the correct manifest. Otherwise the submission procedure might assume that you submit an extension and then your store listing will simply not work. The only way to solve this if it happens to you, is to make a new submission. The previous one is characterized as an extension and this cannot be changed and the submission cannot be deleted. Use this tutorial for instructions don’t forget the part

  "app": {
    "urls": [
      "http://mysubdomain.example.com/"
    ],
    "launch": {
      "web_url": "http://mysubdomain.example.com/"
    }


this makes all the difference between an app and an extension.
See the listing of my app as an example.
After listing your app, any Chrome user may download it. Chrome places downloaded apps in the app menu regardless if they are packed or hosted. So the apps are functional in the Chrome environment like any other app or extension.
In Firefox Marketplace you are also required to place a .json type manifest, but as it has to have the .webapp extension you have to declare in the metadata of your server that the manifest is of type
<mime-type>application/x-web-app-manifest+json</mime-type>
this is a platform dependent procedure and there is a lot of documentation about it in the help files of the Marketplace. The syntax of the manifest is quite trivial, unless you wish to put special installation parameters.
The interesting thing is that when a Firefox user downloads an app in Windows, the app is installed like a regular windows app that may be removed only from the Control Panel. In fact, Firefox installs a small app which is basically a browsers window named after the downloaded app with some cache memory. When a user runs this installation the hosted app opens in this window which has different functionality than Firefox normal windows. This feature is useful as your hosted app runs like a local app improving user experience.
The downside of Firefox Marketplace is the review process. It takes a lot of days, a week or more. And some of the reviewers must not be very experienced. The reviewer of my app didn’t know how to run it; despite the help files in it. So I had to send him detailed instructions and wait even more days for the approval of my submission.