AppInstallOffLine Method (CLIENT)


PLB Web Only, 9.9B

 

The AppInstallOffLine method adds or removes entries from the 'plbwebaddr.txt' file. This file is located in the mobile device persistent storage path. This method is implemented to allow 'Plbwebcli' client buttons to be configured so they can start 'Plbwebcli' offline user web apps. The method uses the following format:

 

[label]

{object}.AppInstallOffLine

[GIVING {return}] USING [*Name=]{name}[:

 

 

[*HTML=](html}][,[*CSS=]{css}][,[*JS=]{js}][:

 

 

[*OPTIONS=]{flags{]]

 

Where:

label

Optional. A Program Execution Label.

object

Required. A CLIENT object.

return

Optional. A Numeric Variable that returns the success or failure of the method.

name

Required. A Character String Variable or string literal that is used for the name\text of the 'Plbwebcli' button that starts the offline user web app.

html

Optional. A Character String Variable or string literal that specifies the file name of a HTML file located in the persistent storage of a mobile device. This HTML file is associated with the 'Plbwebcli' offline button being installed.

css
Optional. A Character String Variable or string literal that specifies the file name of a CSS file located in the persistent storage of a mobile device. This CSS file is associated with the 'Plbwebcli' offline button being installed.
js
Optional. A Character String Variable or string literal that specifies the file name of a file that contains JavaScript and is located in the persistent storage of a mobile device. This JavaScript file is associated with the 'Plbwebcli' offline button being installed.
flags
Optional. A Numeric Variable or decimal number that specifies a bit mask value that controls the behaviors of this method.

Flags Affected: OVER, ZERO

Note the following:

  1. The ZERO flag is always set when the {return} value is zero which indicates that the method execution was successful. The ZERO flag is clear if the {return} value is not zero which indicates that the method execution failed.

  2. The OVER flag is set if the {return} variable is too small to receive the numeric result.

  3. The {html} parameter contains the file name of a HTML file that has been previously downloaded into the persistent storage on a mobile device. The contents of the HTML file need only contain the HTML <body> contents a web page. The <body> and </body> tags are not included in the HTML file data. The HTML file can also include JavaScript <script> routines.

  4. The optional {css} parameter contains the file name of a CSS file that has been previously downloaded into the persistent storage of a mobile device. The CSS file data contains the classes used in support of the user web app.

  5. The optional {js} parameter contains the file name of a JavaScript file that has been previously downloaded into the persistent storage of a mobile device. The JavaScript file data contains the JavaScript routines used to support the offline user web app. There is a special JavaScript function name 'ProgramStart' function that must exist in the JavaScript routines or in the HTML file contents. The 'Plbwebcli' client executes the 'ProgramStart' function to start the execution of the user offline web app.

  6. The optional {flags} parameter is a bit mask value that control behaviors of this method. The {flags} bit mask values are defined as follows:
     

  7. Value

    Meaning

    0

    Install\configure button with jQuery Mobile support. This is the default.

    1

    Install\configure button without jQuery Mobile support.

    2

    Remove 'Plbwebcli' button with the {name} title. In this case, the {html} parameter is not used.

     

  8.  The {return} pass\fail values are defined as follows:
     

  9. Value

    Meaning

    0

    The method executed successfully.

    1

    Cordova is not supported

    2

    The method failed and extended error information can be retrieved using the CLIENT 'AppExtendedError' method..

 

Example:

 

Install\configure a 'Plbwebcli' button that starts the execution of offline web app.

 

 

 

Client.AppInstallOffline

Using "Offline File": //Button title.

 

 

"t1.html": //Html file.

 

 

"t1.css": //CSS file.

 

 

"t1.js" //JavaScript file.

 

 

 

 

Client.AppInstallOffline

Using "Offline Test1": //Button title

 

 

"": //Not used.

 

 

*Options=2 //Delete the button.

 

 

See Also: CLIENT, Client Methods, Method Syntax



PL/B Language Reference AppGetPicture Method (CLIENT) AddJs Method (CLIENT)