Noutați

Incredible Wind Triangle Solving App Is Made In Delphi

We’ve written before about some of the wonderful ways Delphi developers are helping pilots with the difficult job of defying gravity in their aircraft. The reliability of Delphi applications and the cross-platform power of FireMonkey FMX framework, combined with the skillful craftwork of the software engineer seems to lend itself very neatly to solving problems. Aviation is one of those areas in which modern mobile devices can be the perfect tool to assist with the mind-boggling situations and tasks a pilot must address. Creating a mobile application with RAD Studio and Delphi is extremely easy – freeing up the developer to focus on the complexities of the problem rather than being bogged down in making the mobile app actually work. E6B is a flight computer and it’s written in Delphi The E6B app, from Delphi Developer Micriconsult based in Oostende in Belgium, is a mobile app which solves a “wind triangle” for pilots of light aircraft. The users enter four values out of six. The six values are three speeds and three angles. The app calculates the remaining two unentered values of the six. Micriconsult says  “it then explains how you get these results with a flight computer, by animating it. It rotates the disk, slides it and add marks. It also shows what value to use for each step towards the solution. This app runs on Android devices and preferably on tablets. On devices with smaller screens, you may need to zoom.” What are the features of The E6B Flight Computer app? E6B solves any kind of wind triangle problem and explains how to find those results on a regular flight computer. It contains an accurate visualization of a flight computer. Each of the different steps are animated toward a solution. Users can tap the “explain” tab to get a short explanation of the app. The app supports zooming in (two fingers gesture) and pan (one finger gesture) to ease accessing the data entry controls or to enlarge a part of flight computer. It supports portrait and landscape layout. Users can change the language to the language settings of the Android device. Available languages are English (Default), French, German, Spanish and Dutch. Google Play E6B Basic Flight Computer Screenshot Gallery

Read More

Implementing A Blazing Fast IoT Network With MQTT

What is IoT? The IoT term defines the concept of internet-connected physical devices that can send and/or receive data. To exchange data easily, a protocol of communication must be used in order of any devices can communicate with another one. The only requirement is that all devices must communicate in an agreed way. For IoT, the MQTT protocol is one of the top choices. What is MQTT? MQTT is short for Message Queuing Telemetry Transport. It’s a communication protocol Machine-to-Machine (M2M) designed initially for networks with low bandwidth and preferably bi-directional. It was developed for gas and oil industries in 1999, a time when the network bandwidth was typically very low. Its usage was extended to IoT, automation and is used by Facebook for its well-known Messenger product. Here is an overview of MQTT See below a schema of a typical MQTT protocol architecture: What are MQTT entities? This architecture is Client/Server with an implementation of publish/subscribe. There are three roles in this protocol : The Broker : The broker acts like the server of a network using MQTT. All messages go through it but its only role is to send messages to the targeted clients. The Publishers : these entities send data. The Subscribers : these entities receive data. A client application using the MQTT protocol can be a publisher or a subscriber or even both. How do I build an MQTT message? To summarize: an MQTT message is built with a title that we name Topic. The Topic is a string written with some rules. Some data can be exchange in addition of the Topic to complete the message. We can draw a parallel between MQTT call and REST call like this by comparing the MQTT Topic with URL endpoint in REST. Subscribers ‘listen’ to a message Topic and Publishers send message with a specified Topic. The Broker forwards messages to Subscribers that listen the specified Topic in the message. A client of MQTT network can subscribe to multiple Topics and publish multiple Topics too. MQTT is an extremely flexible messaging protocol to use in your Delphi and C++ Builder applications. What are the rules of writing MQTT Topics? MQTT Topics are structured in a hierarchy similar to folders and files in a file system using the forward slash ( / ) as a delimiter. Some exemples / /house /house/livingroom/conditioner /house/livingroom/lights MQTT protocol introduces some possible wildcard in the Topic : # (hash character) – multi level wildcard + (plus character) -single level wildcard Then a client subscribing to /house/# will listen all message starting with /house . A client subscribing to /house/+/lights will listen to all messages which match the “lights” wildcard specifications (for example living room, kitchen bathroom). It can be used to switch on or off all lights of the house. To develop a Delphi MQTT client, we will use ready-made component provided by TMS Software : TTMSMQTTClient component available for Windows/Android/IOS/Linux. TMS Software provides an installation package with a trial version here. You can use the TTMSMQTTClient component to easily implement MQTT Let’s have a look at the component provided by TMS Software. How do I connect to an MQTT server? This component provides of course several properties. To connect to a MQTT server the minimum settings to set are : BrokerHostName : host name where the MQTT […]

Read More

Powerful Dashboards with REST API & Delphi MVC Framework

The Delphi MVC framework (DMVC) is a popular and powerful framework for web solution, that allows the MVC architecture in Delphi. With it, we can create powerful RESTful servers without effort. In this article we will make a Delphi MVC example and create a dashboard through Serenytics using their REST API. A REST API is an application program interface (API) that uses an architectural style, based on representational state transfer (REST), allowing interactions between REST web services. An API is a set of requests that allow data communication between applications. It uses HTTP requests for data manipulation. REST is a set of restrictions used so that HTTP requests meet the guidelines defined in the architecture. Therefore, REST API means using an API to access back-end applications, so that this communication is done with the standards defined by the Rest architecture style. Creating a Simple REST API Using Delphi MVC Framework To follow our example of creating a simple REST API server in Delphi you need to first install the extremely popular and well-respected Delphi MVC Project – from Embarcadero MVP Daniele Teti – which can be found at this link: https://github.com/danieleteti/delphimvcframework There is an install guide for DelphiMVC, here: https://github.com/danieleteti/delphimvcframework#install-the-latest-stable-version After the installation, go to your Delphi and create a new DelphiMVC Project. You should see a screen like this: Create some classes to use with Delphi MVC and the REST API In this case, I’m getting data from a customer table on my database so, I change the field ‘Controller Class Name’ to TControllerCustomer. If you open your controller, you can see endpoints and methods already created. We need to implement the ‘GetCustomers’ to expose the data but, first, we need to get this data from somewhere. Create a new unit that is gonna be our Model. A Model is a class representation of the data. Our Customer Model looks like this: Finally, create a function to get the data from the database but remember to return a list of your model. In our case: On the Controller unit, go to GetCustomers and call the function you created. Now we need to convert the objects list to JSON. DMVC makes it easy for us with the ‘Render’ method. To convert a list of objects, we can do: Render(TCustomer.GetAllCustomers); RenderTCustomer>(TCustomer.GetAllCustomers); Example results from a Delphi MVC application That is all you need to do. If you run your application and go to the path of the method, you will see: How do I create a dashboard with Delphi using a REST API? Now you have your API endpoint and you can use it to feed an AI, a mobile app, another application, and, of course, create dashboards. As I said in my introduction, I will be using the Serenytics website for this. The Serenytics dashboard visualization is free to use. First, create an account with Serenytics. Then, on the left menu of the main screen, go to DATA and then add ‘New data Source’. Choose WebServices & API and finally, REST API. Note that Serenytics cannot access ‘localhost’ domains. Getting and running the ngrok application We are going to use an application called “ngrok” to help us test our Delphi application. Go to the official ngrok website’s download section here: https://ngrok.com/download Download the ngrok application. When we run ngrok creates […]

Read More

Google Maps heat maps

We recently received a question whether TMS FNC Maps supports heat maps. Heat maps are supported in Google Maps and we immediately went exploring the capabilities upon this request. More info and a sample about heat maps can be found here: https://developers.google.com/maps/documentation/javascript/examples/layer-heatmap. TMS FNC Maps comes with a lot of great functionality as well as a (lesser visible) customization events and methods to add your own extensions. To add support for heat maps, we had to override 2 virtuals and we can do this by inheriting from the TTMSFNCGoogleMaps class. Customizing the API URL TTMSFNCMaps (and TTMSFNCGoogleMaps), expose a lot of virtuals to extend and customize existing or new functionality. To support heat maps, we needed to add an extra parameter to the URL that is required to load the Google Maps JavaScript API. This can be done by overriding the GetHeadLinks procedure. procedure GetHeadLinks(AList: TTMSFNCMapsLinksList; ACheckReady: Boolean = True); override; Additionally, we need to change the link to include an additional parameter: “libraries=visualization” to enable the library required to load the heat map layer. procedure TTMSFNCGoogleMapsEx.GetHeadLinks(AList: TTMSFNCMapsLinksList;   ACheckReady: Boolean); begin   AList.Add(TTMSFNCMapsLink.CreateScript(‘https://maps.googleapis.com/maps/api/js?key=’ + MapsProperties.GetAPIKey + ‘&language=’ +     MapsProperties.GetLocale + ‘&libraries=visualization’, ‘text/javascript’, ‘utf-8’, ”, True, True)); end; Adding additional JavaScript functionality After extending the API URL to load the required libraries we need to add custom JavaScript to visualize the heat map. According to the sample (following the link at the top), we need to add code to visualize heat maps in San Francisco. To add custom JavaScript functionality, override the DoCustomizeMap virtual. procedure DoCustomizeMap(var ACustomizeMap: string); override; The code specified in the sample translated to Delphi code is shown below. procedure TTMSFNCGoogleMapsEx.DoCustomizeMap(var ACustomizeMap: string); var   h: string; begin   h := ‘var heatMapData = [‘ + LB +   ‘{location: new ‘ + MAPSERVICEVAR + ‘.LatLng(37.782, -122.447), weight: 0.5},’ + LB +   ‘new ‘ + MAPSERVICEVAR + ‘.LatLng(37.782, -122.445),’ + LB +   ‘{location: new ‘ + MAPSERVICEVAR + ‘.LatLng(37.782, -122.443), weight: 2},’ + LB +   ‘{location: new ‘ + MAPSERVICEVAR + ‘.LatLng(37.782, -122.441), weight: 3},’ + LB +   ‘{location: new ‘ + MAPSERVICEVAR + ‘.LatLng(37.782, -122.439), weight: 2},’ + LB +   ‘new ‘ + MAPSERVICEVAR + ‘.LatLng(37.782, -122.437),’ + LB +   ‘{location: new ‘ + MAPSERVICEVAR + ‘.LatLng(37.782, -122.435), weight: 0.5},’ + LB +   ‘{location: new ‘ + MAPSERVICEVAR + ‘.LatLng(37.785, -122.447), weight: 3},’ + LB +   ‘{location: new ‘ + MAPSERVICEVAR + ‘.LatLng(37.785, -122.445), weight: 2},’ + LB +   ‘new ‘ + MAPSERVICEVAR + ‘.LatLng(37.785, -122.443),’ + LB +   ‘{location: new ‘ + MAPSERVICEVAR + ‘.LatLng(37.785, -122.441), weight: 0.5},’ + LB +   ‘new ‘ + MAPSERVICEVAR + ‘.LatLng(37.785, -122.439),’ + LB +   ‘{location: new ‘ + MAPSERVICEVAR + ‘.LatLng(37.785, -122.437), weight: 2},’ + LB +   ‘{location: new ‘ + MAPSERVICEVAR + ‘.LatLng(37.785, -122.435), weight: 3}’ + LB +   ‘];’ + LB +   ‘var heatmap = new ‘ + MAPSERVICEVAR + ‘.visualization.HeatmapLayer({‘ + LB +   ‘  data: heatMapData’ + LB +   ‘});’ + LB +   ‘heatmap.setMap(‘ + MAPVAR + ‘);’;   ACustomizeMap := h;   inherited; end; Bundling this all together produces the following result. The complete code snippet (written in FMX, but can be used in any framework) unit UGoogleMapsHeatMap; interface uses System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants, FMX.Types, FMX.Controls, […]

Read More

RAD Server CRUD Procedures – Part 2

In this Part 2 post, we will discuss modifying the default generated CRUD (CREATE, READ, UPDATE, DELETE) procedure implementations from the RAD Server Package Wizard, to show one possible way to implement Get, GetItem, Post, PutItem and DeleteItem REST Endpoints. In the Part 1 post, we discussed the default generated CRUD procedure implementations from the RAD Server Package Wizard. In the Part 3 post, we will discuss implementing a FireMonkey (FMX) REST client to call and interact with the RAD Server CRUD procedures. The Embarcadero RAD Server (also known as EMS – Enterprise Mobility Server) uses the industry standards of REST, and to transfer data to and from the RAD Server REST Service, JSON – JavaScript Object Notation, is typically used as the transfer encoding. Due to the Embarcadero RAD Server supporting industry standard REST and JSON, we will use Delphi’s, C++ Builder and/or RAD Studio’s REST Client Library components  (TRESTClient, TRESTRequest, and TRESTResponse ) on the client, and  System.JSON classes (TJSONArray and TJSONObject) and FireDAC on the RAD Server to implement our CRUD procedures. Also note, newer versions of RAD Server have introduced new frameworks and components that allows for greater control of the data retrieved by desktop, multi-device, web and other service-based applications that connect to your RAD Server application. For example the EMSDataSetResource Component is discussed here and other RAD Server Improvements introduced in RAD Studio 10.3.2, like the RAD Server Database Mapping Wizard, and Swagger API Documentation Improvements, are discussed here. OK, now let’s dig into the details! First, for our application we want to access and perform CRUD procedures on our Employee Table from our InterBase Employee Database. For the Employee Table, I’m using the sample InterBase Employee database, located at: localhost:C:UsersPublicDocumentsEmbarcaderoStudio21.0Samplesdataemployee.gdb Recall from the part 1 post, using the RAD Server Package Wizard, , we created a package with resource. This created for us a Data Module. A Data Module is like a special form that contains nonvisual components. We can now add FireDAC data access controls onto our Data Module to access our Employee table. On our uResourceModule unit we can add our FireDAC controls to connect to the InterBase Employee database and Query the Employee Table: The easiest way to do this is to use the IDE’s Data Explorer Tab and create a new FireDAC connection to the InterBase Employee database: Then, select the Employee Table from the Tables node. And then drag and drop the Employee Table onto the Data Module form: This will add two FireDAC components on your data module. EmployeeConnection is the FireDAC connection (FDConnection) to your InterBase Employee database, and the EmployeeTable is your FireDAC Query component (FDQuery) to perform the SQL SELECT * FROM EMPLOYEE, to return all rows from the Employee table. To test the FDQuery EmployeeTable, double-click the FDQuery EmployeeTable component. This will open the FireDAC Query Editor, and show us the SQL Command for this FDQuery EmployeeTable, like this. The SQL is SELECT * FROM EMPLOYEE Click the Execute button, to verify you get all the rows return from the Employee table: Get (READ) Procedure Recall from the part 1 post, we saw the RAD Server Package Wizard, generate a default GET (READ) procedure implementation like this: Here is how we modified the default GET procedure to use FireDAC and System.JSON Classes (TJSONArray […]

Read More

The Future Of Desktop Apps Is Native Code

Desktop apps are powerful execution tools that can natively run on your local machine to provide holistic application navigation and utilization experiences. With the advancement of modern web technologies, the desktop application development paradigm also experienced a major drift in terms of implementation. Technologies such as JavaScript and Python have inspired the hybrid implementation of desktop apps. Hybrid app implementations have enhanced the ability of web developers to deliver desktop apps but the decreased performance and increased memory consumption are a significant downside. Since desktop apps run the application code locally on your machine, we cannot compromise on the performance and memory usage by getting rid of the native code. The future of desktop apps still lies in the native code. In this blog post, we’ll look at why native code is the future of desktop apps by comparing the performance and memory usage of Delphi with other desktop application development frameworks such as WPF .NET and Electron. Can Electron deliver an optimized solution? Visual Studio Code is an Electron app and generally performs pretty well. A developer might think that all Electron apps can achieve the same performance as Visual Studio Code but generally that is probably not the case. Microsoft has a huge task force of developers working on the project and has put a lot of effort, time, and money to optimize the VS Code application. In most cases, other companies do not have the enormous budget as giants like Microsoft and hence cannot match the optimization efforts to deliver a high-performant application using Electron. Running a a few unoptimized applications might still be fine, but we know for a fact that our systems indeed have the capacity to run more. When you choose to operate with more than a few, say five to ten, unoptimized applications then they adversely effect the system and application runtime performance. In such scenarios, RAD Studio that consists of Delphi and C++ Builder becomes an ideal choice of adoption for desktop application development. Now let’s look at the performance test results from the Embarcadero Whitepaper. According to Discovering the Best Developer Framework through Benchmarking by Embarcadero Technologies, the end-product performance, which depends on startup times and runtime memory, is one of the four aspects of effectiveness for the success of applications. The consumers judge applications based on the runtime performance and businesses choose the frameworks that have a higher performance. The specialists at Embarcadero Technologies used the development and analysis of a benchmark Windows calculator app and evaluated its performance against the Delphi, WPF, and Electron frameworks and libraries. How does Delphi Contribute to Application Performance and Startup Time? When it comes to performance and startup time of applications, according to Embarcadero’s commissioned whitepaper, frameworks that produce applications with shorter startup times facilitate good user experiences and minimize the system resources well before the application is ready to be used. Startup time is especially important when loading an executable or application over a network because network speeds can be slower than loading applications via the local hard drive. According to the experimentation done in the whitepaper, the benchmark calculator app built with Delphi gave a startup time of 0.239 seconds on average from the local files, whereas from the network files, the average time was recorded to be 0.439 seconds. The slowest startup […]

Read More

Automatically Label Objects In An Image With DenseCap API And Javascript

As businesses and individuals move increasingly online, they accumulate large volumes of data in the form of digital images. If you have found yourself in this position, then you are definitely aware that to efficiently organize, analyze, and edit your images takes plenty of time. It takes so much time, in fact, that often the only good solution is for you to develop your own high-quality software to ease the ever-increasing load. Thankfully, there are tools available to you that speed things up, and they do it using AI and machine learning. They perceive and recognize objects within your images and automatically label them appropriately. In addition to being very useful for organizing your directories full of digital images, they also help you search for and discover the important information contained within your images. DeepAI.org has created a number of these machine learning and computer vision technology tools. DenseCap API in particular scans and adds captions to your images by identifying objects they contain. Most importantly, DenseCap API is fast. It takes seconds to scan and caption even your largest images. If building your own AI and machine learning apps interests you, then read on to find out how you can quickly build a Sencha Ext JS app that automatically labels objects in an image. Let’s get started building an app that looks like this: What is the DenseCap API by DeepAI? So what does the DenseCap API do? Simply put, the DenseCap API takes your image input and returns a JSON object that contains information about each item or object it detects within the image. For object it identifies it returns the following three attributes: Object label Confidence value of the object Coordinates/bounding box of the object within the image. The great thing about DeepAI is that the API key is provided for free. You can use this key to try out their interface and once you run out of a fixed number of queries, you can get your own key. To see it in action for yourself, first, open the command line in Sencha Cmd and type the following: curl -F ‘image=https://images.pexels.com/photos/4198322/pexels-photo-4198322.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=750&w=1260’ -H ‘api-key:42638949-3cf9-486b-a063-eaf5f4df0634’ https://api.deepai.org/api/densecap Pasted below is a part of the JSON text that the API returns. The API actually identifies more objects for this image, but we are only showing two of them below to help you gain an understanding of how the API works:  {   “id”: “26f9959b-2001-4f98-a648-99c6f8856190”,     “output”: {         “captions”: [             {                 “caption”: “a white plate with a white frosting”,                 “bounding_box”: [                     420,                     189,                     578,                     589                 ],                 “confidence”: 0.9974018335342407             },             {                 “caption”: “a small orange bowl”,                 “bounding_box”: [         […]

Read More

Developer Stories: Serkan Şahinoğlu Shares More About His ForPrompt Studio Software

Serkan Şahinoğlu started programming since 1995. He submitted his ForPrompt Studio showcase entry at the Delphi 26th Showcase Challenge and we interviewed him to get more insight on his experiences with Delphi. Head over to the ForPrompt Studio website for the product and how to use it. When did you start using RAD Studio Delphi and how long have you been using it? Since 1995, I have been developing software in Delphi and various languages for 26 years. It has been part of many of my projects since Delphi 1. Thanks to its practicality, it helps me to finish the product in a short time. What was it like building software before you had RAD Studio Delphi? With Delphi  a simple database application could be developed in minutes without writing any code, even twenty years ago, using embedded components for database. How did RAD Studio Delphi help you create your showcase application? As I mentioned earlier RAD Studio is extremely rapid application-oriented, this is my very first mobile application developed while learning Firemonkey for the first time, this really proves RAD studio has really good features to get the work done fast. When my projects need rich interface and practicality, I mostly turn to Delphi. Several times I prepared DLL libraries and external modules with C++ and C# for custom applications and used Delphi again for the interface. What made RAD Studio Delphi stand out from other options? I usually prefer Delphi when developing software with extensive interfaces. With hundreds of visual components and features ready, I can focus on my actual work without dealing with unnecessary details. After doing projects in Visual Basic, Visual C++, C#, and other programming languages, I came to the conclusion that Delphi is a practical software development tool that can producing rapidly. Now it has reached an advanced level that can compile the same project for Windows, Linux, MacOS, iOS, Android operating systems. What made you happiest about working with RAD Studio Delphi? One of Delphi’s my favorite features is that all libraries have clear and readable source codes. By examining them, we can program them more efficiently and easily to understand what is going on behind our code up to the operating system level because it is written very practically and understandably. They also help you learn how to coding. Since the software we produce with Delphi is standalone exe file, the fact that it can be easily transported and operated without the need for additional installations speeds up our business. I can also share my practical small software with my friends as a single small exe file. The VCL library, which cleverly encapsulates the massive Windows API, its practicality in database applications, and the fact that there is no longer the need to encode heavy DirectX/OpenGL thanks to FireMonkey are all my favorite aspects of Delphi. It’s nice that the DXScene/VGScene library, which I bought a lifetime license a few years ago, soon came across as FireMonkey and evolved to its current level. What have you been able to achieve through using RAD Studio Delphi to create your showcase application? The teleprompter render engine I created in Firemonkey sends floating reading text to the laptop monitor or to screens in the TV studio via I/O cards such as Decklink and AJA. In […]

Read More

Another webinar with another first …

If any of these technologies are of interest to you, we have a new webinar coming up with another first!Reserve your first class seat now while it can here.  We will show you for the first time in public, the latest state of project Miletus in TMS WEB Core.  To give you a hint, we only show today this screenshot: First time you hear about the word Miletus? Read up here and then reserve your seat!  With your registration, you’ll see & discover it first-hand in our online webinar running in our own fully web-based TMS Web Academy platform developed here using TMS WEB Core for Visual Studio. We look forward to meet you in the webinar and discuss via the platform the many new capabilities that open up for Delphi developers.  See you!

Read More

Discover our wide range of TMS FNC Components

FNC stands for Framework Neutral Components. This means that the components can be used cross-framework and cross-platform. With our TMS FNC Component studio bundle you will get access to all our current FNC components! That is not all! You will save over 45% now and even more with new free FNC component releases! All products come with perpetual licenses and 1 year of FREE updates & support. Subscriptions can be extended for another year at 70% discount! Products included in the bundle: Get full access to FNC components: Components for Delphi & C++Builder that can be used in all project types. Only one learning curve: VCL, FMX, LCL and WEB. Target Windows, macOS, iOS, Android, Linux and WEB. Growing range of components, new products on the way. Yearly renewal only 145 EUR* instead of regular 495 EUR. All products accessible via TMS Subscription Manager tool. Full online support through TMS Support Center. *The price is valid for this moment & depends on the price of the pack at the moment of renewal. Learn More: Want to learn more about FNC and how you can benefit from it? Join us on our upcoming webinar: “What is FNC : Introduction to the growing family of FNC technology based components“, on June 22, 2021. Act now: Find out more about our products included in TMS FNC Component Studio and get your license today! NOTE: Contact sales for special upgrading pricing for existing customers of other products.

Read More