Pt 5: Building a Database Driven App
In part 5 of this tutorial, we add additional functionality to the database-driven Books Catalog sample app started in the previous videos. This tutorial shows how to add, delete, and save data to the app database. To build your own native, low-code app for iOS, Android, and Windows, download the free MobileTogether Designer: https://www.altova.com/mobiletogether View all tutorials in this series here: https://www.altova.com/mobiletogether/demos#video-database-driven-apps Files used in this tutorial are available here: https://www.altova.com/documents/MobileTogetherDemoFiles.zip 0:12 The first step in this demo is to set up functionality to allow users to add Authors and Books to the database using the app. Starting with Authors, we create a table and combo box with an Add Author button. Then, we assign Actions to the button using the Action Trees dialog, which allows low-code programming of complex app behavior. When users click the Add Author button, the Edit Author page we defined in Part 3 of this series will open as a modal (aka pop-up) dialog. 2:30 Next, we configure the Edit Author subpage itself by setting up an Action that will create a new row in the database with empty attributes, so the user can add a new author. First, we need to check whether the author the user is adding already exists in the database. This is accomplished with an if/then condition and function to append a blank tree structure that corresponds to the Edit Author data source when the author is not present. 3:30 New IDs auto-increment and will be assigned to new records automatically, and we won’t have to create additional actions to handle new IDs. 3:48 Running the simulator tests how the new Add Author functionality works. Now, we’ll add the Delete Author functionality to remove data from the database. In the OnButtonClicked Action definition, we will first show a message asking the user to confirm that they really want to delete the record from the database. 5:56 Now that we’ve set up adding author data, adding functionality to add new books to the database is similar. 6:35 There is also a Delete button for books, which is configured in a similar manner to the same button on the Edit Author subpage. Now we’ll simulate the app to test all the functionality we just added. Finally, we can optimize the UI a bit, using the Styles and Properties entry helper to set the maximum table height on the main app page. This will allow the header and combo box for adding an Author to remain at the top of the screen during scrolling. Tune in to Part 6 of this series as we finalize our app by adding functionality to search the database: https://youtu.be/Vu-k8Qusxs8
Download
1 formatsVideo Formats
Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.