After the author of the My Visual Database framework stopped developing his project, calls are increasingly heard on the developer forum for a new project that would take the banner of the revolution in the production of applications for work with databases.

Alas, the project is stuck in the past, where the corporate sector needed simple small enterprise-level programs that work with single-user databases or over a local network. And ordinary people did without the Internet, using simple programs and multimedia applications to meet their everyday needs. Now give everyone the Internet, the phone (or rather, a smartphone) has replaced the computer, business activity has shifted towards the use of services.

What’s in stock?

My Visual Database has the ability to generate a site for the MySQL database, but it does not support user authorization and therefore is not commercially useful. It’s a pity – it could extend the life of this wonderful project: the generation of a full-fledged site would allow for mobile data access. What do the developers want, and I am one of them?

My Mobile Database

An application development system for use on mobile platforms. In fact, these should be multi-platform applications that run on Android and iOS, and at the same time on Windows, Linux and MacOS.

Databases

Of course, ideally it should still be the same SQLite for local connection and MySQL for network connection, which would ensure compatibility with existing projects created on the My Visual Database framework , but I allow any options that would solve two classes of problems: individual and collective use of data.

Access technologies

There are only two options for transferring the entry point to a mobile device: a browser that connects to a site adapted for the phone, and a native application in which the data management functionality is implemented programmatically, including connecting to the database and managing data.

Tools

My Visual Database was created in the Delphi development environment that I have been familiar with for many years, so it was logical for me to consider building a new system using this tool.

Delphi

I did a little research to find out three questions:

  • Can Delphi replace My Visual Database?
  • Can Delphi be an alternative to My Mobile Database?
  • Can Delphi create My Mobile Database?

Let’s start with the good news: on Embarcadero’s official website you can download a special free edition of Delphi Community Edition, which is fully functional and allows you to create both regular and mobile applications. There are two options for debugging mobile applications: connecting a physical device and software emulation. The latter is lame on both legs: I tried several times to set up and connect the emulator, but each time it was a quest in which I had to climb through the motherboard settings, download additional drivers, download SDK updates and dance with a tambourine. Therefore, I decided that I would limit myself to updating the SDK – this is what needs to be done after installing Delphi in order to be able to create applications for Android. Variants with iOS and MacOS are also theoretically possible, but I did not test them in practice due to the lack of appropriate equipment for testing.

Hello world!

The first application just had to run on a computer and phone, and I easily managed it. The main thing is to choose the right type when creating an application: Multi-Device Application.

For experiments, you will need Blank Application – an application with an empty main form.

Next, a label (TLabel) is placed on the form, which is stretched to the entire form (Align = Client).

Components used in multi-platform projects differ from VCL components, in particular the label label is stored in the Text property, and the horizontal alignment is stored in the TextSettings.HorzAlign property.

To get used to the screen proportions that are used in mobile applications, turn on the view corresponding to the smartphone:

Now you need to select the target platform – Android (1). If you connected your phone to the computer and were able to activate the developer mode on it, then after pressing the refresh device list button (2), your phone will appear in the drop-down list (3). We press the start button (4) and the application is created and downloaded to the phone.

Different smartphone models activate developer mode differently, search the Internet for recommendations on your model.

Hello SQLite!

To create an application that connects to a local SQLite database, I used an example from the official Embarcadero documentation, which walks you through the steps of using components FireDAC to data access, interface components from the FireMonkey library, as well as the intricacies of customizing the program code to work under Android.

In order not to retell this tutorial, I will only note the main differences in the use of development tools.

  • Binding display components and data extraction components is done using a special tool – LiveBindings Wizard
  • To add logic specific to each operating system, you must use conditional compilation.
  • To extract data and their modification will have to write SQL queries.

Otherwise, the development principle remains the same: adding and setting component properties, and in the case when there are nuances with the use of resources (in particular, the path to the database), you need to write a little code. However, the code will have to be written all the time – this is not My Visual Database, where the main logic is already implemented in the components themselves. You will also have to study new components that have been created to ensure compatibility with mobile platforms.

In 10 minutes, I managed to create a simple application for displaying and editing a table with the names of a category of dishes. As a database, I used the ready-made sqlite.db file from the “Cookbook” project, but I had to change the extension to .s3db – this is the accepted Android OS for SQLite.

Nice bonuses of the Delphi IDE:

  • you can connect to the database during development and find some errors before running the application
  • you can debug the main logic in Windows application mode

Where is MySQL?!

And then I was disappointed: the FireDAC components (as well as dbExpress), which are part of Delphi, cannot work with MySQL in the mobile version of the applications they create, although they do their job well under Windows.

Exploring alternative possibilities led to the only reasonable result: paid components from Devart that can work directly with the DBMS. The issue price is $500, there is a trial period for testing. It is possible that a little later I will return to this issue, but for now let’s summarize.

Verdict

Delphi can replace My Visual Database. The product contains everything you need to create database applications, but you will need to learn new components and how to use them. Developing applications in Delphi is much more difficult than creating a program in My Visual Database. But due to the lack of development prospects for MVDB, Delphi is the closest alternative available.

Delphi is not fully analogous to My Mobile Database. Due to the fact that standard Delphi components do not allow you to connect to remote DBMS, you need to continue searching for options for implementing a platform for creating mobile applications for working with DB. But for creating applications that work with the SQLite DBMS, Delphi is quite suitable.

You can’t create a complete My Mobile Database with Delphi. This is a preliminary estimate based both on limitations with connecting to a remote database, and on the lack of information about how FireDAC and FireMonkey components are created and configured in application runtime. Namely, the principle of operation of MVDB and MMDB is based on this.

Don’t you have exactly the same, but with mother-of-pearl buttons? – Not. – Will seek…

Leave a Reply

Your email address will not be published. Required fields are marked *