Running your application

Contents Hide

 

To run the applications created in BrightBuilder, it calls BrightForms the form execution engine for Bright Software applications. BrightForms will process and execute the application definition files and resources, then launch on the target device.

Note: These methods of execution will update the project logic and resources, and create any tables which are not present on startup. In Version 9 onwards, tables will be automatically updated if their definition on the device differs from the BSP, however, this will not occur for version 8 and below. If Version 8 or lower is being used, and table changes have been made, it is suggested to manually drop the tables from BrightForms' local database, or deploy and synchronise the application to have the changes applied by Application Distribution.

When synchronising to the server with applications which have been executed via the execute button(s), in order to avoid application distribution, ensure that the user account configured does not have an application assigned. This is signified by a blank or deleted entry under the project column in BrightServer's Users Panel.

Execute button

To execute a project, select the BSP project from the Projects panel. With the project name is highlighted, tap on the Execute button or press F6 to run the application on a locally installed BrightForms.

By default, BrightBuilder will have BrightForms executable registered in the default path of C:\Program Files\BrightSoftware\BrightForms\BrightForms.exe. If this executable cannot be located, the dialog below will appear, requesting its location.

With a valid BrightForms executable, BrightBuilder will then export all project files into the "Documents and Settings" directory for the current user for BrightForms to read. Typically, this will be located at C:\Documents and Settings\<windows user id>.

If BrightBuilder cannot locate this folder, BrightBuilder will also prompt for this local export directory in which it will store the project files.

After this directory is confirmed, BrightBuilder will continue the execution process, writing the files to this project directory and launching BrightForms. Any directories specified in the process will be saved for future project executions.

They may also be changed at any time via BrightBuilder Directory Settings, located in BrightBuilder's Tools > Options dialog.

Execute on Windows Mobile Device

BrightBuilder is capable of running applications on a PDA through Microsoft ActiveSync. With the PDA connected to the computer and ActiveSync installed, simply follow these steps to do remote testing,

  1. Select the project name to execute and click on the Execute on Remote Device button or press F7.

  2. BrightBuilder will search for the PDA Downloader executable at the default location C:\Program Files\BrightSoftware\BrightBuilder\bin\BSDownloader.exe. If BrightBuilder was installed at a different location the following dialog will request the location of this executable.

    Specify the PDA Downloader executable program in the Select the PDA Downloader executable dialog box.

    The PDA Downloader executable is included in the installation disk and can be located in BrightBuilder\bin installation directory.

  3. BrightBuilder will export the project to the local export directory and then connect to the PDA through ActiveSync, the following dialog will appear, displaying the progress of device connection.

  4. If the remote device is present, the PDA Downloader will download the export files to the Remote Export directory and the Remote BrightForms executable will run the application in the PDA.

If ActiveSync could not make a connection with the device, the following error message will be displayed,

Check the connection with the PDA and the computer and run the application again.

Execute on Android Device

Both BrightBuilder and the Android device must be configured to enable project execution via the BrightBuilder interface.

Note: Please ensure that the device is able to connect to the development machine correctly via USB. It may be necessary to download the correct and most up-to-date USB drivers from the OEM provider of the Android device if this is not the case.

Configuring the Android Debug Bridge

In BrightBuilder, confirm the Android Debug Bright executable (adb.exe)'s path via the 'Options' dialog (Tools -> Options). This directory is set to the "<INSTALL_DIR>/bin/" by default. In order for BrightForms to be able to push applications to the device, the BrightForms Android Package (APK) must also be located in the directory of the adb.exe file.

If BrightForms was bundled with BrightBuilder on installation, this should also be in the default adb.exe path. If BrightForms wasn't bundled with BrightBuilder, or the Android Debug Bridge directory has been changed, retrieve the BrightForms APK file, and place it in the directory of the Android Debug Bridge specified in BrightBuilder's options.

If more than one BrightForms installation package is located in the directory of the specified Android Debug Bridge executable, the most up-to-date version of BrightForms will always be pushed to devices via BrightBuilder.

Configuring the Development Device

To connect to an Android device using BrightBuilder, the device must first be set into USB debugging mode.

To do this, on older devices, go to the Settings menu from the Home screen, and select "Applications", then "Development". From here "USB Debugging" may be turned on. You may be prompted to restart your device at this time.

On newer devices, locate the 'Build Number' entry under the System > About Phone in Android's settings. Tap the row repeatedly until a message saying developer mode has been enabled. A new 'Developer Options' section will be available from the Settings screens. Tap on the top row's 'On' slider to turn it on, and ensure 'USB debugging' is also activated.

 

Once USB Debugging is set, and the Android Debug Bridge has been configured, BrightBuilder may be used to push projects onto the device.

 

Pushing Projects to Android Devices

Once the device settings and BrightBuilder's Android Bridge path have been set, projects may be pushed onto Android devices. To do this, perform the following steps:

  1. Select the BSP to run and select "Execute on Android Device" either from the right-click context menu or the main tool bar's icon.

  2. The following notification may appear on the target Android device. Tap 'Always allow from this computer' then tap OK to continue. BrightBuilder may not execute projects if the computer is not allowed. As such, if BrightBuilder fails before the PC authorised authorise the computer, and try again.

  3. BrightBuilder will firstly validate the project, then install BrightForms to the Android device, and finally launch the project on the device. The progress of this process may be observed in the status bar of BrightBuilder.

  4. If BrightForms installed properly, the application will display on the device (if BrightForms is not already open) after the splash screen displays. The BrightForms icon should also be available in the app drawer of the device.

Note: On some devices, the "Android Export Option" path may also need to be changed, as some devices will install BrightForms to a different directory than the default set. This may be changed via the "Android Export Option" in the Tools -> Options dialog of BrightBuilder.

One such device is the Samsung Galaxy Tab. In this case, the export path is "/mnt/sdcard/external_sd/Android/data/au.com.brightsoft.android.application/files" (note, the "external_sd" directory). Once set via the Tools -> Options dialog, BrightBuilder will be able to push project files correctly to the device.

Executing on Other Platforms

Executing projects on iOS or Windows Phone platforms requires the project to be deployed to a BrightServer instance, and then synchronisation of the project via application distribution on the device.

For more information, please refer to the BrightForms > Application Distribution section of this document.

Validate button

Another feature of BrightBuilder is its built-in feature that validates the project application definitions before execution. Validating a project involves BrightBuilder inspecting the application definition for any errors in its content. It can detect whether a data source is valid, a table has a primary key, that there is a valid query for the sync rules and much, much more. This ensures that no data is left out in the making of the application. This is also a guide, in which it warns of the points that may have been forgotten such as initialising the Default Selection property of a group of radio buttons or selecting the main form to execute.

To validate a project, simply select the project name, making sure it is on focus and click the Validate button or press F5. This will open a new Output Window like the one below, and show any errors or warnings in your project. It will also list these errors and warnings so that you will know what to change and correct.

Validation has two options in the Execution Settings. These are,

  1. Prompt on Validation Errors set to true if BrightBuilder is to prompt asking whether to continue or to abort execution, when there are errors in the project. The following dialog will be displayed,

  2. Validate before Execute set to true if BrightBuilder is to validate the project before every execution