Delphi

What Is It Like To Be A Developer Brian Barr?

Hello. This article is part of a series where we speak with professional software developers, ask them what it’s like to write code for a living, and perhaps gain a few insights into the software development industry along the way. Talking to us today we have fellow British Delphi fan Brian Barr. Brian is based in Norfolk, England nestled by the English East Coast which brought back many nostalgic memories to me of driving through the wonderful local countryside since my own late father used to live in that area. Brian has a fascinating background coding Delphi programs for use in the TV and radio industry even before the launch of Delphi 1. His Barrcode application reaches an astounding 50 million listeners and viewers products every week. Thank you for taking part in the interviews Brian! Thanks for the homework! 😂 What would be your brief evening news summary of who you are and what you do? Written Delphi programs for the TV and radio industry before Delphi 1 came out. Started writing in BBC Basic for the BBC Model B. Wrote digital playout systems for the biggest commercial radio stations in the UK. Now writes software for the major TV channels in the UK. How and/or why did you become a developer? I was a radio station engineer working with electronics, I needed to learn programming to write some automation systems to support diversely skilled staff. Do you think you will ever stop being a developer? If so, what would be next? Never Brian is not actually from Florida What made you start using Delphi/C++ Builder? As I recall, I saw Delphi 1 in a magazine. I needed to program on the Windows PC platform and Delphi showed much promise. If you could give some advice to a student who is considering a career as a software developer, what would it be? Research the subject thoroughly. Principles of programming are pretty universal – all languages have an IF statement and various loops. Get used to structuring your code so that when you are old, you can still work out what it does. Tabs… or spaces? Spaces – silly!! Don’t get me started on where the “begin” should be. What’s the best day you ever had as a developer? Too many – getting a major contract for Capital Radio in London – led to many more stations. What’s the worst thing about being a developer? When things go wrong – you feel responsible for the chaos. What’s the coolest development tip you know? When things don’t work – it’s always YOUR fault! Work from home, work from an office, work in an open plan / shared space? What do you prefer and why? Do you get to choose? Work from home. My time is my own, also the freedom to leave the keyboard when my brain aches. Tell us something interesting you think we might not know. Darth Vader IS Luke’s father!! Have you been to Silicon Valley? If so, how was it? If not, have you ever wanted to? Who wouldn’t want to program in the sunshine? Have you ever met any famous/well known tech figures? Who was it? How did it go? Because I was in a radio station, I met many “famous” people. Once was shown round […]

Read More

How To Create A Super-Fast Pusher Notification App

What is Pusher ? Pusher is a set of bidirectional APIs targeted on real time communication. The main use case of those APIs are : Real time charts (cryptocurrency values) Network games (synchronization of players) In app chat (application support) Real time results (basketball, soccer, baseball) Instant geolocation (products to home delivery) What are the main specifications of Pusher ? Pusher is a publish-subscribe messaging system that allows to exchange messages reliably and effectively. Pusher solves by design the problems of : Scale of number of messages and users The real time constraint of messages delivery. Pusher supports the concept of channels. A channel of communication can have 4 different type : Public Private Encrypted Presence What is a Public Channel in Pusher? Public channels should be used for publicly accessible data as they do not require any form of authorisation in order to be subscribed to. What is a Private Channel in Pusher? Private channels should be used when access to the channel needs to be restricted in some way. In order for a user to subscribe to a private channel permission must be authorized. The authentication occurs via a HTTP Request to a configurable authentication url when the subscribe method is called with a private- channel name. What is an Encrypted Channel in Pusher? An encrypted channel is similar to a private channel. However the content of the message is end-to-end encrypted  This encryption follows the specifications of the Secretbox encryption standard defined in NaCl and the message is encrypted before it leaves the server. Only authorized subscribers have access to the channel specific decryption key. This means that nobody except authorized subscribers can read the payload data, not even Pusher. End-to-end encrypted channels also provide end-to-end authenticity; that is your messages are protected from forgery, and that they are guaranteed to come from someone who holds the encryption master key. What is a Pusher Presence Channel? Presence channels build on the security of Private channels and expose the additional feature of an awareness of who is subscribed to that channel. This makes it extremely easy to build chat room and “who’s online” type functionality to your application. How can I integrate Pusher into my Delphi app? The first step is to create an “application” on Pusher.com First of all users need to subscribe to the Pusher network and create an application. Pusher will generate several ids and keys needed to use the Pusher system as follows: With all this data, the developer will be able to interact with the Pusher system. How do I connect to the Pusher network with the TsgcWSAPI_Pusher component of ESEGECE? The low-level communication with Pusher is based on web socket. As a result you can find a Pusher component in the websocket component suite of ESEGECE. You can download the component suite from here. The component installation is done by the compilation the bpl for the Delphi version. There are full instructions and it’s quite easy to do, even for novices. Now, in RAD Studio Delphi, create a new application and drop on the main form the web socket component TsgcWebSocketClient and the Pusher component TsgcWSAPI_Pusher. In the property of the pusher component we will need to set : sgcPusher.Pusher.Cluster := ‘eu’; sgcPusher.Pusher.AppId := myAppid; sgcPusher.Pusher.Key := myKey; sgcPusher.Pusher.Secret := mySecret; sgcPusher.Pusher.TLS := True; […]

Read More

The 5 Best Reasons Why Security First Is A Good Idea

Balancing data privacy and security with user experience is one of the most complex tasks for software developers.  Many projects have higher priority for business functionality and security-related tasks are lower priority which leads to an insecure system. Here are some reasons why putting security to the forefront of our designs and development are essential. The security by design methodology should be enforced in the product design and development stages to make more secure and reliable software. Rather than applying security at the final stages of the software, it is better to start the project with security awareness. Finding the issues related to the security of the project at the final stage of the development process might force the development team to expend further unplanned time to re-architecture or make dozens of changes.  One of the problems with poor security design on software is the exposure of sensitive data. For instance, the simple scenario is that the user enters his/her account and clicks an image to download it. What if that link is available to others and there is no authentication or resource protection? Something as simple as a compromised linking strategy can be difficult to fix after the fact and could eventually lead to a steep drop-off in user confidence and corresponding plummet in adoption of your app or service. When talking about security by design we need to define several terms. Classic information security usually includes confidentiality, integrity, and availability. Keeping information secret that should not be made known to the public. For instance, your healthcare record – Confidentiality When your information is safe and does not change by any third party, this is Integrity. For instance, votes for election. Availability implies that the information is at hand on time. For example, when there is a call for a hospital, they need to know the location and the address immediately. All 3 factors are mandatory if you are concerned about security by design in your project. Moreover, in recent years many governments and legal bodies have introduced rules which require traceability of data use, access and dissemination. This features in laws such as the European GDPR regulations. Traceability is another factor we must consider to ensure that if the data is accessed, that connection should be traceable. Security by design starts from the approaches that you do with your code. If you ask five developers to design software, you will get five different answers. But only a few of them ask how the objects interact with each other and how the system should be protected.  To create better software you should care about: Design patterns System architecture Activities and connection of classes Even writing if statement or utilizing for loop security These all qualify as part of the software design process. In the traditional software development process, security should be a top priority when developing and write code. So, everyone involved in the process should be trained and experienced in software security. At the very least developers need to know about the cross-site scripting attacks, vulnerabilities in low-level protocols, and the OWASP Top 10. By being aware of these, developers approach the development process differently, for example, they start to care about input sanitization, security configurations, or outdated components in their toolset. Dozens of tools and services are available that protects your entire […]

Read More

5 Ultimate Ways To Modernize Your Apps For Windows 11

Delphi offers a modern, robust & enterprise-grade UI developer environment with Visual Component Library (VCL) for Windows only and FireMonkey (FMX) for cross-platform development. Delphi VCL offers the latest features and modern UI controls for your Windows app development.  Moreover, you can enjoy the native performance in your Delphi app, and accessing to hardware and latest features of Windows is quick with Delphi. In this article, we try to point out five main ways to modernize your apps for Windows 11. Users love when they can easily find what information the app is gathering and easy-to-understand privacy-policy notices. So, informing about all this and giving access to enable or disable telemetry settings is always welcome. The comprehensive design forms a more reliable product and environment for everyone. For instance, if your app is consists of lots of text content, it is more salutary to add an assistive screen reader that is also satisfactory for people with disabilities. Describe the UI controls or menus with beautiful and simple animations. Make your app scalable and responsive as much as you can. Provide font size changing option. Because you never know how your app represents in different sized screens. If your app welcome screen shows different information with several frames, make sure to give the option to redesign the frames. Delphi 11 IDE gives access to alter the layout On Windows 11, you can see most of the icons are updated with shiny and coherent icons. Besides, the new UI font called Segoe UI Variable makes the typography of your app more readable and softer. Src: Windows Docs Delphi VCL provides modern Windows UI controls with native performance.  By bringing beautiful and modern UI controls, your app looks shiny and up-to-date with Windows 11. Since Windows 11 itself has so many UI innovations, your app needs compatible with it! In addition to that, using lightweight and scalable animation in your app can increase user experience. Because everyone loves beautiful things. One of the popular ways of adding animations to the applications is using Lottie animation files.  Do you know how to add Lottie animation files to your Delphi app? Well, it is easy because of community contribution to the Delphi development ecosystem! Skia4Delphi is a cross-platform 2D graphics API for Delphi platforms based on Google’s Skia Graphics Library. Here you can watch the Desktop First session about Lottie and SVG in Delphi by Jim McKeeth Windows 11 introduced a wide array of UI elements and rounded corners to the desktop operating system. The usual sharp edges are now rounded and smooth corners which gives another feeling about desktop apps.  As you utilize Windows 11, the rounded corners on every UI control look great in both dark and light modes.  Here you can learn how to controls Windows 11 rounded corners with code: Delphi VCL has exceptional options to make your app look modern with VCL Styles. With dozens of different and unique styles, you can create modern-looking Windows apps in seconds by just applying styles.  How to design Fluent apps in Delphi – Acrylic material design? If you want to build your app by applying the Fluent design system, you can easily achieve it with the StyleControls VCL package. StyleControls VCL package uses classic drawing, system themes, GDI+, and VCL styles to make unique user interfaces. In recent years, we can see that some apps are designed for touchscreen mode also. For instance, when I use my 2-in-1 laptops, you need bigger […]

Read More

Announcing DelphiCon 2021!

Delphi 11 Alexandria is taking software development to whole new levels, and DelphiCon 2021 is the best way to learn all about your favorite programming language. Sessions are planned around the latest features, as well as general best practices, and emerging technologies that apply to all versions. There are also sessions on integrations with other languages (C++, Python, etc.) and platforms. DelphiCon 2021 is a free online conference the week of November 14th, 2021. It is the official worldwide Delphi conference! If you were registered last year then we saved you the trouble registering again. So if it says you are already registered then you are ready to go! Stay tuned as we announce more session details. Planned sessions topics: Artificial Intelligence, Best Practices, Productivity, APIs, Graphics and Design, Integrations, Tools, Components, Libraries, Windows 11, Low Code, Android, iOS, Linux and Blockchain. We are in the process of working with MVPs, Technology Partners, internal Embarcadero experts, and industry leaders, to build a line-up like no other. Beyond the traditional sessions, there are interactive sessions planned – a chance for you to try new things with immediate feedback. I’d also love to hear from you: What sessions or content would you like to see at DelphiCon 2021? Leave a comment and let me know. FAQ: How much is DelphiCon2021? ➡️ DelphiCon2021 is completely free! What about C++Builder? ➡️ We will look at a C++ specific event during the first part of next year. Will there be replays? ➡️ Sometimes it takes a while to get all the replays online, but you unfortunately miss the opportunity to ask the presenter questions. Is the content in English? ➡️ All content will be in English, but we are looking at options to make the content more accessible to all attendees. Do I need to install Delphi 11 first? ➡️ It isn’t required, but it is highly recommended. Will the content cover Delphi (Insert random version number)? ➡️ Some of the content will be applicable to all Delphi developers, but you increase the odds of things being compatible by being on a recent version. Can I speak at DelphiCon 2021? ➡️ We are currently soliciting sessions from MVPs and Technology Partners, but we are curious to cover a large variety of topics. Leave a comment and let us know what you have in mind. Who is speaking at DelphiCon 2021? ➡️ Close your eyes and imagine the best speakers with the best sessions. That is our goal. Leave a comment with your suggestions and reach out to your dream speakers and encourage them to speak! Be ready for DelphiCon and getting the latest and greatest Delphi! Download RAD Studio 11 Alexandria today!

Read More

How to create a blazing Pusher chat with Delphi ?

Pusher is a set of bidirectional APIs targeted on real time communication. The main use case of those APIs are : real time charts (cryptocurrency values) network games (synchronization of players) in app chat (application support) real time resuts (basketball, soccer, baseball) instant geolocalization (products to home delivery) Pusher is a publish-subscribe messaging system that allows to exchange messages reliably and effectively. Pusher solves by design the problems of : scale of number of messages and users the real time constraint of messages delivery. Pusher distings itself from other publish-subscribe systemby introducing the concept of type of channels. A channel of communication can have 4 differents type : Public Private Encrypted Presence Public Channel Public channels should be used for publicly accessible data as they do not require any form of authorisation in order to be subscribed to. Private Channel Private channels should be used when access to the channel needs to be restricted in some way. In order for a user to subscribe to a private channel permission must be authorized. The authentication occurs via a HTTP Request to a configurable authentication url when the subscribe method is called with a private- channel name. Encrypted Channel Encrypted channel is similar to a private channel. However the content of message is end-to-end encrypted  This encryption follows the specifications of Secretbox encryption standard defined in NaCl and message is encrypted before it leaves the server. Only authorized subscribers have access to the channel specific decryption key. This means that nobody except authorized subscribers can read the payload data, not even Pusher. End-to-end encrypted channels also provide end-to-end authenticity; that is your messages are protected from forgery, and that they are guaranteed to come from someone who holds the encryption master key. Presence Channel Presence channels build on the security of Private channels and expose the additional feature of an awareness of who is subscribed to that channel. This makes it extremely easy to build chat room and “who’s online” type functionality to your application. Create application on Pusher.com First of all as for facebook or telegram, user needs to subscribe to Pusher network and creates an application. Pusher will generate several id and keys needed to used Pusher system as follow : With all these data, the developer will be able to interact with Pusher system. Connect to Pusher network with the TsgcWSAPI_Pusher component of ESEGECE As the low-level communication with Pusher is based on web socket, it’s quiet obvious to find a Pusher component in the websocket component suite of ESEGECE company. Download  the component suite from here. The component installation is done by the compilation of the bpl regarding the Delphi version. Create a new application and drop on the main form the web socket component TsgcWebSocketClient and the pusher component TsgcWSAPI_Pusher. In the property of the pusher component we will need to set : sgcPusher.Pusher.Cluster := ‘eu’; sgcPusher.Pusher.AppId := myAppid; sgcPusher.Pusher.Key := myKey; sgcPusher.Pusher.Secret := mySecret; sgcPusher.Pusher.TLS := True; sgcPusher.Pusher.Version := myVersion; sgcPusher.Pusher.Name := myName; sgcPusher.Pusher.Cluster := ‘eu’; sgcPusher.Pusher.AppId := myAppid; sgcPusher.Pusher.Key := myKey; sgcPusher.Pusher.Secret := mySecret; sgcPusher.Pusher.TLS := True; sgcPusher.Pusher.Version := myVersion; sgcPusher.Pusher.Name := myName; for the websocket component the property will be set a following : wsClient.Port := 443; //means secure because TLS of Pusher component is on wsClient.Host := ‘ws-eu.pusher.com’; wsClient.Port := 443; //means secure because […]

Read More

New in RAD Studio 11: High DPI IDE and Form Designing!

There is a very exciting improvement in Delphi, C++Builder and RAD Studio 11.0 Alexandria: the IDE now fully supports high DPI scaling on high-resolution screens. This means that if you use Windows and have a 4K or similar high-res display, the IDE will render crisply and clearly on your screen. In fact, if you have two screens with different scales, you can have different IDE windows on those multiple displays and each will render perfectly, crisp and clear, on each monitor. This high DPI scaling support using the VCL’s own support for perMonitorv2 scaling, which we introduced a couple of releases ago, plus our own image collection and virtual image list components. In other words, we use the same tools we make available to you. Importantly, high DPI support includes support in the code editor, for crisp text, and when designing forms, both VCL and FMX. (If you’ve started RAD Studio 11 and thought, ‘hey, my form is small!’ read onwards – we have settings controlling the scaling in the VCL form designer and you’re set to unscaled by default.) Let’s dig into how the IDE behaves on both high-res and low-res displays today, some interesting notes about how it was implemented, and look at VCL form designing in particular. High DPI Comparison The best way to see the difference in the IDE is to use it. Using the IDE on a high-res display is like night and day – there are some things that screenshots only half convey, and what the RAD Studio 11 look and feel is like is one of them. In person, it’s an amazing difference. Here is a great image Jim McKeeth created comparing the 10.4.2 and 11.0 IDEs: On the left, the old DPI-unaware IDE in 10.4.2. It draws low-res, so is blurry when scaled up.On the right, the new high-DPI aware IDE in v11. It is crisp and clear no matter how high the scaling. You can see that the image on the right, in v11.0 Alexandria, the text and icons are clear no matter how large the display the IDE is placed on. Background – why High DPI? 2x the pixel density A typical scale set in Windows today is 200%. This is 2x the pixel density, which really means that for each pixel in the past, there are now four pixels (it is divided into two vertically and horizontally.) I am writing this on a 4K monitor, which is 2160 pixels high. That is 2 times 1080, a vertical resolution that before high DPI I used for years. To get everything to appear the same physical size onscreen, I need to scale by 2. If an app doesn’t support high DPI (is ‘DPI unaware’), Windows will scale it up, but upscaling adds blurriness. It is much better if an app is aware of the scaling applied to the screen its window(s) are on and can draw crisply. We added support to the VCL for this in 10.3, supporting perMonitorv2 high DPI scaling (the latest and best of the options Windows provides) and adding in components for high-res icons and image drawing, providing better support for high-res images in toolbars and menus that Windows has inbuilt. The IDE, which is mostly built with the VCL, uses these and is a great demo […]

Read More

How To Build A Powerful Real-Time Stock Market App

Wouldn’t it be nice to have Stock Data Real-Time, Intraday & Historical Market information for your business and be able to instantly retrieve up-to-date data for any ticker down to the minute, request intraday quotes or search 30+ years of accurate historical market data? The stockmarket API is capable of delivering accurate data for 170,000+ worldwide stock tickers, from more than 50 countries, as well as 750+ market indices, information about timezones, currencies, collected from 70 global exchanges, including Nasdaq, NYSE, and more. In this article we will see how fast and easy it is to use RAD Studio and Delphi to create a Firemonkey multidevice application using the LowCode Wizard in addition to a REST client library to take advantage of market stack API and retrieve a JSON format response for stock market data in real-time. Our RAD Studio and Delphi applications will be able to call the API and request information based on the name of parameters you provide. How do I set up the MarketStack API? Make sure you refer to MarketStack API website (https://MarketStack.com/) and and sign up for the free plan providing only your email and some basic information (no credit card required). Once you are in the website will redirect you to a quick start guide dashboard and your API Access Key will be provided. The Access Key unique, personal and is required to authenticate with the API. Keep it safe! How do I call MarketStack API endpoints? Now all we need to do is to call the API base URL (http://api.marketStack.com/v1/) via a HTTP POST method with no JSON request body needed and some few requested parameters added to the URL address depending on the ednpoint we choose to call. One can do that using REST Client libraries available on several programming languages. marketStack offers several API endpoints to choose from: End-of-Day Data: Get daily stock market data. Intraday Data: Get intraday and real-time market data. Tickers: Get information about stock ticker symbols. Exchanges: Get infotmation about all supported exchanges. Currencies: Get information about all supported currencies. Timezones: Get information about all supported timezones. Our demo will focus on the End-of-Day endpoint but all the others follow similar logic but with different parameters passed. For a complete and detailed list of endpoints and its parameters make sure you refer to MarketStack Quickstart guide (https://marketStack.com/quickstart) // Intraday Data API Endpoint http://api.marketstack.com/v1/eod ? access_key = YOUR_ACCESS_KEY & symbols = AAPL // optional parameters: & interval = 1h & sort = DESC & date_from = YYYY-MM-DD & date_to = YYYY-MM-DD & limit = 100 & offset = 0 // more parameters available please refer to the API Documentation (https://marketStack.com/documentation) // Intraday Data API Endpoint http://api.marketstack.com/v1/eod ? access_key = YOUR_ACCESS_KEY & symbols = AAPL   // optional parameters: & interval = 1h & sort = DESC & date_from = YYYY–MM–DD & date_to = YYYY–MM–DD & limit = 100 & offset = 0 // more parameters available please refer to the API Documentation (https://marketStack.com/documentation) What does the MarketStack API endpoint return? You can use the API’s eod endpoint in order to obtain end-of-day data for one or multiple stock tickers. A single or multiple comma-separated ticker symbols are passed to the API using the symbols parameter. After the call is done main results will be as shown below, […]

Read More

5 Ways To Enhance The Security Of Windows Apps

Every organization wants to get ahead of security, and security is essential for everyone. Having a secure system always helps you to avoid future problems with your customers.  These current advanced and different technologies that you use give lots of risks to build secure systems. But there are always best practices to prevent dozens of vulnerabilities in your app. Developing a secure app can be a challenge. Customers expect apps to become available and updated faster than ever. In this post, we will try to cover best practices to enhance the security of Windows applications. The better way to protect your source code – preventing people from stealing your ideas and implementation – is to use Delphi. Developing the Best Developer Framework through Benchmarking – This white paper shows really good and real-world metrics of three different frameworks. The white paper includes: Delphi WPF with .NET Electron Overall, it proves that Delphi offers high productivity and better security alongside great functionality. Moreover, when Delphi VCL and FMX demo apps were decompiled, we can see that all the logic code was presented as an assembly which makes it hard to extract source code structure. While when C# WPF and JavaScript Electron demos are decompiled, the source code is easily exposed to a standard text editor. Besides, if you are against reverse engineering of your Windows programs, you can utilize obfuscating tools. Learn more about obfuscating in this tutorials: This shows that with, Delphi programming language with VCL and FMX frameworks, you can achieve high performance and better security over your application. You can learn more about all the comparisons and metrics, be sure to check out these posts: Data-in-flight refers to the connection and the messages transferred across it. For instance, you might need to create a server & client application. In this case, rather than using third-party security protocols, you can rely on platform-specific protocols and layers. RAD Studio offers native and cross-platform Internet Client and Request components to create secure and reliable internet bases programs. The use of Secure Sockets Layer (SSL) and Secure Hypertext Transfer Protocol (HTTPS) ensures the security of the connection. This helps to block intermediary parties from accessing the connections. This kind of authentication is based on a single-user credential which is usually a password. If you are going to build your single-factor authentication you can learn the process here: The user gives a username and password to the identity provider. The provider verifies the identity of the user. The identity provider validates the given username & password. In most cases, the password is encrypted and provides additional security so that others can not read it. Then the identity provides return True or False that indicates authentication status Finally, if it is successful, the system gives access to the user. The problem with Single-factor authentication is that passwords can be easy to guess. This can be solved by adding another layer of the requirement to get into the system. For instance, applying secret questions and regular password changes.  Use an EDP Module. Since we are talking about Windows app development, we are in a better place compared to the web environment. Microsoft Windows 10 and 11 offer Enterprise Data Protection (EDP). The EDP module guards enterprise data against unintended or malicious use and it provides 4 levels of protection: Block, […]

Read More

11 Tutorials For Working With Ethereum From Delphi

Ethereum is used to create decentralized applications that utilize the benefits of cryptocurrency and blockchain technology. These decentralized applications (dapps) can be trustworthy which means that once they are deployed to the Ethereum network, they will always run as programmed. They can control and regulate digital assets in order to create new kinds of financial applications. They can be decentralized in a way that no single entity or person controls them and are nearly impossible to censor. In this blog post, we’ll look at some of the most popular and effective tutorials that can help you adapt to a quick hands-on for working with Ethereum from Delphi. How can I connect Delphi to a local (in-memory) blockchain? This simple tutorial primarily focuses on connecting Delphi to a local (in-memory) blockchain using Delphereum, which is a Delphi interface to the Ethereum blockchain.  There are a few prerequisites and GitHub repositories/libraries that are required before you actually move on to using Delphereum. After that, you will be required to download and start a Ganache instance to run your personal Ethereum blockchain. Once Ganache is up and running, you can move ahead and start a new Delphi project. For simplicity in understanding, the tutorial uses an easy approach of just connecting to an Ethereum blockchain and retrieve the account balance.  <br /> const<br /> URL = ‘http://127.0.0.1:7545’;<br /> begin<br /> web3.eth.getBalance(TWeb3.Create(URL), Edit1.Text, procedure(qty: BigInteger; err: IError)<br /> begin<br /> TThread.Synchronize(nil, procedure<br /> begin<br /> if Assigned(err) then<br /> MessageDlg(err.Message, TMsgDlgType.mtError, [TMsgDlgBtn.mbOK], 0)<br /> else<br /> ShowMessage(web3.eth.utils.fromWei(qty, web3.eth.utils.ether) + ‘ ether’);<br /> end);<br /> end);<br /> end; const   URL = ‘http://127.0.0.1:7545’; begin   web3.eth.getBalance(TWeb3.Create(URL), Edit1.Text, procedure(qty: BigInteger; err: IError)   begin     TThread.Synchronize(nil, procedure     begin       if Assigned(err) then         MessageDlg(err.Message, TMsgDlgType.mtError, [TMsgDlgBtn.mbOK], 0)       else         ShowMessage(web3.eth.utils.fromWei(qty, web3.eth.utils.ether) + ‘ ether’);     end);   end); end; For a detailed and descriptive understanding, check out the full-length tutorial here.  How can I connect Delphi to the Ethereum main net? The previous tutorial focused on connecting Delphi with local (in-memory) blockchain. In this tutorial, we take a step forward and connect Delphi to Ethereum main net.  To connect to the Ethereum main net, you will need to sign up for a free account on Infura to get a project ID. <br /> const<br /> URL = ‘<your_infura_project_endpoint>’;<br /> begin<br /> web3.eth.getBalance(TWeb3.Create(URL), Edit1.Text, procedure(qty: BigInteger; err: IError)<br /> begin<br /> TThread.Synchronize(nil, procedure<br /> begin<br /> if Assigned(err) then<br /> MessageDlg(err.Message, TMsgDlgType.mtError, [TMsgDlgBtn.mbOK], 0)<br /> else<br /> ShowMessage(web3.eth.utils.fromWei(qty, web3.eth.utils.ether) + ‘ ether’);<br /> end);<br /> end);<br /> end;</your_infura_project_endpoint> const   URL = ‘‘; begin   web3.eth.getBalance(TWeb3.Create(URL), Edit1.Text, procedure(qty: BigInteger; err: IError)   begin     TThread.Synchronize(nil, procedure     begin       if Assigned(err) then         MessageDlg(err.Message, TMsgDlgType.mtError, [TMsgDlgBtn.mbOK], 0)       else         ShowMessage(web3.eth.utils.fromWei(qty, web3.eth.utils.ether) + ‘ ether’);     end);   end); end; Notice that in the code above, we have replaced the local Ganache blockchain URL with the Ethereum main net link that we retrieved from Infura.  For a detailed and descriptive understanding, check out the full-length tutorial here. Can I connect Delphi to smart contracts? In this tutorial, the idea is to explore how can you connect your Delphi applications with the deployed Ethereum smart contracts. The tutorial uses BNB’s smart contract and synchronizes the execution state with the main thread for a seamless connection.  <br /> var<br /> Client: TWeb3;<br /> const<br /> URL = ‘https://mainnet.infura.io/v3/your-project-id’;<br /> begin<br /> Client := TWeb3.Create(URL);<br /> web3.eth.call(Client, ‘0xB8c77482e45F1F44dE1745F52C74426C631bDD52’, ‘symbol()’, [], procedure(tup: […]

Read More