You can generate the code to interact with the mobile device's features. This example
shows how to call a selected phone number from the app.
-
Open the appflow.4ba file.
-
Right-click on the BA diagram and select .
-
Right-click on the Form entity and select New
Relation. Click on the Form entity again and drag the
Relation arrow to the Phone entity.
-
Select the Relation between the Form and the
Phone entity and set the Action property to
callContact. Set the Phone Number property to the phone
column (account.phone in our example database).
-
Save your changes to appflow.4ba.
-
Double-click on the Form entity to open it in Form Designer. Add a
button that triggers your callContact action.
-
Expand the canvas and the grid that is containing the form fields if you need room to add a
button.
-
Select from the menu.
-
Draw a button onto your form. Set the name property of your button to
callContact. The name of the button is also the action to be triggered by the
button.
-
Set the text property of the button to Call Contact.
-
To preview your form, select .
-
Make further changes to your form if you wish.
-
Save your changes to the form.
-
Execute your program, this will rebuild your program and execute it in one step.
-
Test the new button.
Tip: The sample data in the phone field is not a valid phone number. Run the app and
select to update the phone field with a phone number of your choice. On the Android
emulator, the MENU button displays the available program actions.