Web-based apps are quite popular today. Whether they are for mobile, or desktop devices web applications do not require installation and manual updating as they are stored on a web server. This means there’s only one place for you, the developer, to maintain, and for mobile apps it also has the added benefit that you don’t have to get your code to be accepted in any app stores which can be a lengthy and difficult process. One of the main reasons why many business owners opt to create web apps is the fact they will work on a wider range of devices running on different operating systems without the need for you to directly support them as development targets with native compiled apps.
In this article, we are going to explain what tools you can use to easily create web apps and dynamic internet pages using the skills you’ve already learned for Windows development.
Table of Contents
What Embarcadero tools can be used to create web apps?
For more than two decades of its existence, RAD Studio with Delphi, which is maintained and developed by Embarcadero, has been known as a perfect option for the simple and fast programming of Windows apps. After all, the “RAD” in RAD Studio does stand for rapid application development. However, today the range of cases when Delphi can be of great use is much wider, especially if we take into account numerous modern tools that are available to programmers now. One of the spheres where Delphi can be efficiently applied today is the development of web-based mobile apps, including progressive web apps or PWAs.
What is TMS WEB Core?
One of the tools that we’d like to start with is TMS WEB Core. The possibility to create modern web-based mobile apps with it appeared in early 2018. Using this tool, Delphi developers build advanced apps that fully run inside web browsers, translated for you into JavaScript. Developers using TMS WEB Core write their programs as usual with the familiar, regular, Delphi object Pascal language and design the web app’s screens right inside the RAD Studio IDE just like they would when designing a desktop app for Windows or a mobile cross-platform app.
At compile time, instead of the regular Delphi compiler producing a desktop or mobile app the TMS WEB Core framework converts the Delphi program code into a JavaScript library along with a CSS file and one or more HTML files. That net result (pun intended!) is a set of ready to go web pages which are simply copied to a normal web server such as Apache, IIS, NGINX or whatever your choice is. The TMS WEB Core runtime then takes care of running the JavaScript and rendering the web pages.
TMS Web Core can be installed in different versions of Delphi starting from Delphi XE7. It is also compatible with Microsoft Studio Visual Code.
It does not require any specific add-on web servers as the apps are wholly contained in the JavaScript, HTML and CSS files. Such files can be processed by any modern web server without any issues. You write a Delphi program, hit compile, and TMS WEB Core produces the web pages and JavaScript for you.
One additional benefit of TMS WEB Core is that it can output the Delphi code as a progressive web app (PWA) which allows the web app to act more like a ‘real’ app on the user’s device. It can also generate apps which use the Electron framework (used by projects like Spotify and Slack, among others). They even have a new target which competes directly with Electron and allows your web apps to behave much more like a real native app and work cross-platform on a wide range of devices including the Raspberry Pi – they call this target type, Miletus.
Building and launching apps with TMS Web Core, you can be sure that it will be extremely easy to use them and execute in any browser without additional plugins or something else like that.
How does the UniGUI framework help you to create web apps with Delphi?
The UniGUI framework provides a set of unique visual components that help to build, design and debug web applications in the integrated development environment. Each component that is offered in this framework has the same functionality as its analogue in Delphi VCL. This means the process to create web apps with Delphi looks and feels very similar to regular VCL app development. As a result, developers won’t spend need to spend time on learning and getting accustomed to the interface.
UniGUI presupposes the possibility to deploy apps to a server with the help of such options available as ISAPI Module, Windows Service or Standalone Server.
With UniGUI, developers can focus directly on business logic and not concentrate only on the details of the app development process itself. In Softacom’s opinion using this framework, it is possible to significantly reduce the time needed for the development and deployment and, as a result, cut down costs. UniGUI can become a perfect option for both small and large teams.
How to create web apps using Intraweb and RAD Studio with Delphi?
Intraweb is a framework and a component set that allows developers to create interactive websites with the help of Delphi, Kylix, JBuilder and C++ Builder. With all its capacities, it offers a new way to create web apps much easier and faster. Developers even do not need to have any knowledge of HTML or JavaScript to create web apps with this framework. The work with its tools is based on a drag and drop approach.
In general, the process of building apps with IntraWeb is quite similar to the process of creating GUI apps with Borland’s RAD tools. IntraWeb and regular GUI applications presuppose the same basic design method for the UI. Though IntraWeb forms and components are not just the same as their VCL counterparts, they have similar names and are arranged similarly as well.
Doing it the hard way – can I create web apps programmatically?
One more option for building web-based mobile apps with Embarcadero tools is to use the combination of FireMonkey + WebBrowser components.
FireMonkey supplies a Web Browser component as TWebBrowser
. TWebBrowser can be used in web, desktop as well as mobile apps. There is also a TEdgeBrowser component which encapsulates the Microsoft Edge functionality, but this is only currently available for Windows apps.
Using TWebBrowser
you can either serve up static pre-created web pages and display them in your apps or you can inject HTML and other data into the browser view. Note that this is perfectly acceptable, but it’s not really how to create web apps as such.
Why don’t we just create all apps using web technology?
Web apps can be a very good extra tool for your business, and they can help reach customers you otherwise couldn’t due to the wide availability of web browsers on almost every possible type of device and operating system. But they are not the universal answer. Security can be extremely difficult to get right with web technologies and some laws such as the GDPR in Europe and HIPPA in the USA can mean that a web app has to be designed very carefully to ensure the handling of any data is legally compliant.
Performance for web apps and even the ability to run in the first place is entirely dependent on the user having access to a reliable internet connection. Also, some tasks are simple done better with a native app, especially those which process heavily amounts of computation such as network tools or apps which require direct hardware access to things like the GPS, gyroscopes, and mics. Browser technology is improving but it is still not yet as powerful as running apps natively on the device themselves, especially outside of bigger cities and particularly in less developed countries where an internet connection is frequently unreliable or totally absent.
Why use Embarcadero RAD Studio with Delphi to create web apps?
Just like any other tool, Embarcadero tools for building web-based mobile apps have their use cases. However, the main benefit is based on easy-to-understand principles that are usually already well-known to investors and product owners. The fact that programmers do not need to spend a lot of time on getting used to them is one of the factors that helps to reduce development time and costs.
In the case of TMS WEB Core, UniGUI, and Intraweb all of these frameworks let developers use existing skills to create fully functional and extremely powerful web apps using the very easy to learn Delphi programming language. The design of the web app’s pages is completely visual – developers literally drag and drop elements onto the forms to create the screens. All of the libraries support all modern browsers, and, in most cases, they also support popular CSS UI design kits like Bootstrap.
For developers already using RAD Studio with Delphi to create desktop and cross-platform mobile apps there is a huge opportunity too for code reuse – so all those well tried and tested routines and the business logic is almost entirely reusable without modification when you create web apps.
This article was written by Embarcadero Tech Partner Softacom. Softacom specialize in all sorts of software development focused on Delphi. Read more about their services on the Softacom website.