Packaging for GWA

Genero Web Application (GWA) is a Genero application running entirely in the browser.

With a GWA, you do not need a runtime system (fglrun) process on the server side. In fact, there is no other software server side except a web server. A GWA is by default a progressive web app (PWA); meaning once loaded from a web server, it can continue to run offline without any connection to the internet.

A GWA has certain similarities with Genero Mobile for Android™(GMA) and Genero Mobile for iOS (GMI) applications; the main difference is that the Genero runtime is not compiled into native code, instead the runtime system is compiled to WebAssembly modules (wasm) for execution on the web at native speed.

Another noticeable difference between GMA/GMI and GWA, is that a GWA emulates a file system in the browser, whereas in a GMA/GMI application the file systems of Android/IOS® can be used.

For information on configuring Genero Studio with GWA, go to Configure for GWA.

For further information on GWA, go to Genero Web applications in the Genero Business Development Language User Guide.

Package for a GWA application

Creating a package for a mobile platform follows the general packaging procedure.

To create a package for a GWA application:
  1. Navigate to your packages group.
  2. Right-click the packages group and click New Package.
  3. Click Genero Web Application.
Genero Studio creates the Genero Web application package and its directory nodes. A directory node specifies one or more files to include in the package.
Table 1. Default Directory nodes
Directory Contents
Binaries Binary files, such as the compiled modules (.42m files).
Config Configuration files. By default, this node includes fglprofile to provide the database driver and source information.
Database Database files. By default, this node includes db files, because SQLite is the supported database.
Images Image files. By default, this node includes .png, .jpg, and .ttf files, as well as the image2font.txt file.
Resources Application resource files, such as action defaults (.4ad) and style files (.4st).
Webcomponents Web component files.
To specify the module used in the package properties, navigate to the Properties window and within the Package section specify the Main module name.

To define the title used by a GWA application, navigate to the Properties window and within the Package section specify the Label.

For more information, go to Package node properties.

Launch and debug a GWA package

To launch a GWA application, right-click on the GWA package node, select Deploy and then Launch. The Genero Application Server (GAS) launches the application.

To debug an application, choose one of the following options:

  • Right-click on the GWA package node, select Deploy and then Debug.
  • Right-click on the GWA package node, select Deploy and copy the URL from the Output window. In the toolbar select Debug > Debug Genero Application, enter the URL and click Debug.
The GAS launches this application in debug mode. The application execution stops at the MAIN function if you have not set any other breakpoints. To continue the execution of the application, navigate to Genero Studio's debug menu and select the continue icon. For more information, go to Debug menu.

GWAUSERDIR

Genero Studio packages a Genero Web Application (GWA) by copying all files from the directory specified in the GWAUSERDIR environment variable into the gwa directory, located inside the application's distribution folder. For example, you can use the GWAUSERDIR variable to set up a manifest file and favicon to use in your GWA package.

GWAUSERDIR is a Genero Studio specific environment variable. For more information on GST specific environment variables, go to Genero Studio-specific environment variables.

Web application manifest file

A web application manifest file is a JSON file that contains important information about your Genero Web Application (GWA). The manifest file for a GWA is named gwa.webmanifest and is located in the programdir/gwa directory of your project. This file allows you to customize various aspects of your web application, including:

  • Icons: Change the icons that represent your application.
  • Screenshots: Add screenshots to showcase your application.
  • Application title: Modify the title displayed for your application.

For more information on the web application manifest file, go to Web application manifest file in the Genero Business Development Language User Guide.

PhoneDemo

The PhoneDemo_Web_App is part of the package nodes within the PhoneDemo. This provides an example of a GWA package node. For information on the PhoneDemo, go to Genero mobile app demos.