Delphi

What Is A Language Server Protocol (LSP) Anyway?

Have you ever wondered how web browsers can offer smart text options such as auto-fill and hover translate/definition? This is made possible through complex development tools, or IDE Software (Visual Studio, Vims, Eclipse, RAD Studio) tailoring features for each server (C/C++, Java, Python, etc.). This used to be a repetitive process, as each development tool would have to customize its programming language to be read by different servers, which have specific requirements.  When Microsoft introduced the language server protocol (LSP) in 2016, it facilitated an open-code, standardized way to communicate between all development tools and servers. Today, developer companies like Red Hat are continuously adding to the protocol, and programming languages are offering their own LSP capabilities. What is an LSP? A language server is a text-based, standardized language library that uses its own procedure (protocol) through an infrastructure called JSON-RPC (JavaScript Object Notation – Remote Call Procedure). In this instance, JSON (an open-code file format) uses a procedure or method instead of an API (application programming interface) endpoint.  With LSPs, developers can simply integrate these libraries to their editors and refer to existing language infrastructures instead of customizing their codes one server at a time.  For editor builders, they only need a single protocol to support different languages. For language developers, they only need to implement their code in one server to be compatible with numerous editors. Why do we need LSPs? There are two main ways that LSPs have made the coding process easier. Centralized communication. Before LSPs, developers had to duplicate their efforts across major servers, which was time-consuming. With LSP support becoming a service, developers can now focus on integrating LSP into their editors/ integrated development environment (IDE) and expanding their capabilities. Enabled developers to use different editors instead of sticking to just one. Developers can experiment with different plugins and work directly from different IDEs. A word of caution, though.  LSPs are still a work in progress, and not all programming languages are equal. Some languages don’t enjoy the same extensive server support as the more developed ones do. Some protocol extensions are also still server-specific. Still, this concern sits on the developers’ shoulders and not the LSPs. How can I use an LSP? A typical session goes like this. Suppose a user wants to add a ‘Go to Definition’ feature to a document.  When a user opens a document in their IDE, the tool sends a notification to the language server. The tool keeps the file version in memory at this point (instead of in the file directory), which allows all edits to be synced between the tool and the server. Next, the server acknowledges and analyzes any changes that the user implements on the document. If there are any errors, the server will notify the tool.  The user will then send a definition request with specific parameters. The server reflects this request immediately.  Finally, when the user closes the document, the tool informs the server that the document is no longer in memory and has returned to its file location. In general, the editor requests are simplified and the programming language is neutral, which eliminates complexities and confusion. To further standardize LSPs, there are two major software development kit (SDK) libraries that programmers can refer to. First is the development tool SDK, which […]

Read More

This Is The Blockchain And It May Rule The World

If you write apps, whether it be native Windows development, or perhaps targeting a broader market encompassing mobile devices, cryptocurrency is an area of incandescent growth and potential opportunity. Like the white-hot-topic of AI, cryptocurrency is a new frontier, and it seems everybody wants to stake their claim. Cryptocurrency has evolved into a global sensation in recent years, although much is yet to be learned about this evolving technology. Numerous concerns and worries are stirring around technology and its capacity to disrupt traditional financial systems. Cryptocurrency innovators wish to claim that these new forms of monetary exchange are all financial ‘trustless’ systems that are not directly tied to any government or nation-state. But some claim that cryptocurrency, non-fungible tokens – NFTs, the buzz word of the moment, and Blockchain, the technology underpinning these wispish intangibles, are an independent and reliable system. According to Joseph A. Grundfest, an American academic, regardless of whether you think that’s a good or bad thing, it is not entirely accurate. Cryptocurrencies are still reliant on the underlying infrastructure powering cryptocurrencies like Bitcoin, much of which is located in China. So, the Chinese government could theoretically push changes to cryptocurrencies at a fundamental level by setting its will on the data miners who keep them operating. What is the story of NFTs and art? Right now, NFTs are dominating the tech news. News media loves to gorge on stories of life-changing amounts of money being paid for an NFT associated with a piece of art, particularly focusing on facts like the buyer has, in effect, got nothing tangible to show for their hard-earned cash. Combine that with the use of AI to produce original and unique paintings and artworks and you have an almost impossible to resist temptation for a journalist looking to fill out a blank page with some exciting headlines: “anonymous author pays a million dollars for an NFT of an abstract painting by an AI artist”. As a tech person, this use of Blockchain, to secure the details of the sale, might look frivolous when compared to the many different companies solving complex problems with Blockchain and AI. While some others are generating similar non-human “art pieces” using AI or one of the many open-source projects that use layers of images which they combine to generate dozens of variations of images for you to sell online, in the NFT market. It’s less of Bob Ross and more Robot Ross. What is an NFT? NFT stands for “Non-Fungible Token”. This means that you can interchange one asset, here in our case images or animated NFT. This is a unique digital asset representing objects like digital artworks, tweets, pictures, videos, and music. The NFT acts a little like a digital checksum – except it’s a checksum of a moment in time combined with an object. So, the NFT refers to a very specific image or group of images in a way which is incontrovertibly that object or objects. A bit like having a postal code for a train which always meant that someone sending a letter to that postal code would always end up reaching the train no matter where it was or when you sent the letter. It’s a weird thing worthy of the best Wachowski sister movie plot. Hard to understand until someone explains […]

Read More

This Is The Blockchain: Expectations vs. Reality

We have discussed Blockchain technology in our “Everything You Need To Know About Blockchain” article. In that article we have learned about: Immutability Distribution How trust issues can be resolved with Blockchain Blockchain in the financial industry High integrity with Blockchain – and more You might find it useful to read that article first as a useful overview of what people mean by The Blockchain. We also talk about cryptocurrencies built with Object Pascal/Delphi programming language. What is the blockchain? Blockchain is simply a database containing a growing list of records named blocks, linked, and secured using cryptography. Each block holds a hash pointer that links to a previous block, timestamp, and transaction data. So, now we have a chain of blocks or just blockchain as many people call it. To point out that this chain of blocks or database is open, distributes system with every participating computer maintains a copy. What are the expectations of Blockchain? Market investigation indicates that blockchain technology will rule the future because of its many benefits like: Data transparency Immutability Decentralization Security A growing number of people think Blockchain is the future because it inspires a new generation of platforms that are easy to use, accessible, scalable, and interoperable. What is the reality of Blockchain? Despite the possibility that blockchain technology is not supported by many countries because of limits and control over blockchain projects. For instance, governments are fighting to not utilize Blockchain. Unless if blockchain technology matures through enough reforms to support the problems that we are having, it can be applied to every field of our society. Until now, blockchain technology has been a massive breakthrough in the financial industry: Cryptocurrency Decentralized Finance (DeFi) Art Collectibles – Non-fungible token (NFT) When companies started to accept cryptocurrencies, people started looking at the underlying technology that made cryptocurrencies possible. They are based on the basic concepts of cryptocurrencies applied to the deployment of general-purpose applications. These applications are called Smart Contracts, and this defines the business logic and after deployment to the network, it can be used to implement different use cases securely. Is it really worthwhile to integrate Blockchain technology? Technologies take time to be accepted by everyone. Blockchain technology can be a problem in some cases with specific people. But we can see that the financial industry is benefiting from this technology because it offers immutability, transparency, and reliability. For example, Blockchain has all the needed features in supply chains. Supply chain data is not always perceptible, available, or trusted. But blockchain technology helped them to create authenticity over these problems.  How to create decentralized applications with smart contracts in Delphi? You can utilize Delphereum which is an interface for the Ethereum blockchain that allows native development of decentralized applications using the Delphi programming language. In fact, the stability, security and blinding speed of Delphi native applications means it’s ideally suited to the task, Moreover, you can find samples of applications for starting your project with the Ethereum distributed computing platform. You can check out the post below to learn about using Ethereum with Delphi, smart contracts, and more helpful topics. Next-Generation Cryptocurrency – Pascal Pascal, also known as PascalCoin, is a fast, zero-fee, scalable, and decentralized multi-purpose blockchain designed for payments, data operations, and layer-2 applications. Enabled by the SafeBox technology to become the world’s first […]

Read More

How To Automate Large Numbers Of Delphi Project Builds

What is build automation? Despite the ever-increasing rise of mobile devices, desktop applications are still the backbone of enterprise environments. Typically, these enterprise solutions are made up from multiple discrete modules which are harnessed together to create an application suite. But even applications which are themselves monolithic there may exist multiple versions at any one time either to target specific use cases and operating systems or to provide for trialing versions of new functionality. It’s often quite complicated to keep on top of situations like this. It can really become overwhelming once you start to factor in things like cross-platform multi-device targets and functionality which includes localization into different languages such as a user interface which supports English, French, German, Spanish and so on Automating the builds of applications can be a huge improvement for developers who need to make various build scenarios and make repeated actions automatic. Automation can also help prevent mistakes which can creep in during repetitive and tedious tasks as our minds start to wonder or we lose focus. When we think about building web or mobile applications, we can think about techniques such as continuous integration and development pipelines or CI/CD as it’s more commonly referred to. Despite the benefits, developers are still often slow to utilize CI/CD for building and automating the builds and tests on desktop applications. Here’s a few suggestions on things to consider incorporating into your development and release processes which might help. How can I automate Delphi project builds? There are dozens of different solutions available to automate the process of building Delphi projects, but in this spotlight, we’re going to talk about MiTeC Project Maker and with a bonus solution at the end. What is MiTeC Project Maker? MiTeC Project Maker is a tool for automated batch Delphi projects building. With the Project Maker, you can set compiler configurations, define actions processed before and after building, patch version information of built binary, sign that binary with a specified code-signing certificate, apply for 3rd-party software protection, and many more. How does Project Maker work? Project Maker offers a clear powerful interface for project building task definition. Each project can contain an unlimited number of tasks. A ‘task’ represents a Delphi project as defined in a dpr or dproj file. Moreover, Project Maker features Profiles, where you can specify common properties for a project. The project can have an infinite number of profiles. By utilizing profiles, you can simply switch between a variety of build configurations.  Compiler Directives & Options Build options Signing tool Form Cleaner Versioning and more How can we use GitHub Actions to supercharge our GitHub workflow? With GitHub Actions, you can automate, customize, and execute your software development workflows right in your repository.  GitHub Actions are event-driven, meaning that you can run a series of commands after the specified event occurred. For instance, you can set a trigger to pull request event, and when there is a new change GitHub Actions starts code testing. Without any CI/CD integration, you can have everything with GitHub Actions. It gives end-to-end CI and CD capabilities. Additionally, it is in your GitHub repository. How do I use GitHub Actions on Delphi projects? One of the Delphi MVPs, Darian Miller, has written a number of useful articles and tutorials on Delphi. On his RADAuthenticator blog series, he shared his experience on configuring GitHub Actions with […]

Read More

The Pros And Cons Of Artificial Intelligence

Artificial Intelligence, or AI as we have come to refer to it, is a broad-ranging branch of computer science that focuses on automatic ‘thinking’ programs or machines that aim to imitate humans’ problem-solving and decision-making capabilities. Contrary to popular belief, artificial intelligence is built for humans, not to replace us but to make our jobs easier and augment our own abilities.  According to a recent article in Statistica in 2020, “the global total corporate investment in artificial intelligence (AI) reached almost 68 billion U.S. dollars, a significant increase from the previous year”. Also, another report titled “Global Artificial Intelligence in Retail Market Facts & Factors” projects the AI retail market will reach 20.5 billion U.S. dollars by the end of 2026, expanding at CAGR by 39% between 2020 and 2026. However, this parabolic growth in the artificial intelligence industry has led many to ponder what kind of impact AI has already had and will have in the future, with some doubting if AI’s effect will ultimately be for the benefit of society as a whole. What are the Pros of artificial intelligence? Over the years, artificial intelligence has found use cases in various industries, some of which constitute its pros. This article goes through a few of the views of either side of the arguments. Can AI really be useful to make ‘smart’ apps? In our daily life, artificial intelligence has numerous applications. For example, AI, and more specifically, machine learning, is used in face detection when taking pictures with smart devices. It helps in recognition of our live voice chat in smart devices such as Alexa, Apple’s Siri and even Cortana. In Google, the AI provides the facility of typing and responding purely by voice. This is one of the best uses of artificial intelligence. AI also provides direction and mapping in our navigation devices to assist with driving navigations to exact locations. The early navigation solutions were purely algorithmic, using mathematical techniques such as path analysis and optimization and the wonderfully named “simulated annealing” to pluck a good route from the myriad possibilities. Now those navigational instructions are enhanced with AI and machine learning to adapt to traffic conditions it has ‘learned’ have a negative impact on an otherwise good choice of route. Apple devices, for example, will suggest a good time to leave for your regular commute. In common with others it will also pick the nearest restaurants it ‘knows’ you like and apply filters to avoid ones it has learned you dislike. It’s not true AI as such but it’s as close as we have in many ways right now and, overall, I think we’d collectively see it as a great use of ‘smart’ apps. Until the navigation instructions try to get us to make a sea crossing in our car without a ferry – and we’re all surely ‘benefitted’ from the satellite navigation trying to get us to “drive a stupid route five miles out of the way” when our local knowledge knows that there is a shortcut which works better. Are they useful? Yes – anyone who remembers navigating with paper roadmaps or hastily sketched notes definitely appreciates the instant turn by turn instructions spoken by the friendly AI-backed GPS navigation. Is it an Analogue Helper? When we say ‘analogue helper’ we mean can […]

Read More

5 Apps To Help You Manage Your Automation

Advances in control system technology and robotic process automation software are changing how enterprises view and manage business processes and workflows. From improved asset utilization, faster process completion, to real-time data access, automation opportunities are limitless. However, many companies find automation projects challenging to execute as it takes more than “just technical skills” to successfully manage one. You need to ensure you’re leveraging tools that will improve operational efficiency and performance.  Here are five apps you can leverage for successful, rock-solid automation at maximum speed: Did you know Delphi is the fastest and most efficient way to manage automation projects? RAD Studio Delphi is the most powerful Object Pascal IDE and component library for single-source multi-platform Native App Development with flexible Cloud services and broad IoT connectivity. It provides modernized VCL controls for Windows 11 and enables FMX development for Windows, Mac, and Mobile. Delphi is your choice for ultrafast Enterprise Strong Development. Enhancements include support for high-DPI and 4K+ screens, extended multi-monitor support, improved Object Inspector, and much more. Delphi is 5x faster for development and deployment across multiple desktops, mobile, cloud, and database platforms, including Windows 11. Successful automation projects require communication and organizational skills. With Delphi’s enhanced Remote Desktop support (for VCL and IDE), you easily collaborate remotely with your team. Is C++ Builder the ultimate answer to robust, lightning-speed automation projects? C++ Builder is a rapid C++ application development toolset for native Windows, Mac, and Mobile development, with broad Cloud and IoT support. It features updated CLANG 3.3 and C++11 support with the fastest Windows 11 and multi-device development tools. It also allows you to connect natively to over 20 databases like Oracle, SQL Server, MySQL, and more with FireDAC’s high-speed direct access. C++Builder comes with hundreds of components for every task, from creating user interfaces to database connectivity, enabling easy and fast builds for connected business applications on desktop and mobile platforms. In addition to the included VCL and FireMonkey components, a broad range of tools and components are available from the Delphi and C++Builder communities. How can PyScripter leverage Python and Delphi’s winning team for automation? PyScripter is a free and open-source IDE that supports writing, editing, and running python scripts. It has all the features expected in a modern Python IDE in a lightweight package. It’s also natively compiled for Windows to use minimal memory with maximum performance. Although it’s a simple and easy-to-use IDE, it contains more than enough features for professional users. PyScripter is fully developed in Delphi with huge extensibility via Python scripts. Some of its features include: Syntax Highlighting Editor Integrated Python Interpreter Full Python debugging with support for remote debugging Integrated Unit testing Integration with Python tools like PyLint, TabNanny, Profile, etc. Full support for encoded Python source Remote Python Debugger Run or debug files from memory Code Explorer To-Do List Find and Replace in Files Integrated regular expression testing Choice of Python version to run via command line parameters Run Python Script externally (highly configurable) Modern GUI with docked forms Persistent configurable IDE options Have you looked at Embarcadero Dev-C++, the ultra-light C++ power tool? Embarcadero Dev-C++ is a new and improved fork of Bloodshed Dev-C++ and Orwell Dev-C++. It is a full-featured Integrated Development Environment (IDE) and code editor for the C/C++ programming language. It uses […]

Read More

Appercept’s New AWS SDK For Delphi, Available With RAD Studio And Delphi Enterprise and Architect

Embarcadero today introduces a brand new first-class AWS client library for Delphi, soon to be included in the Enterprise and Architect editions of Delphi and RAD Studio. Given the relevance of Amazon Web Service cloud infrastructure in today’s IT landscape, including an AWS library in our product offerings delivers substantial added value to our customers. The Agreement With Appercept Embarcadero has reached a two-year exclusive distribution agreement with Richard Hatherall, the UK-based owner of Appercept, on the company’s “AWS SDK for Delphi”. The deal includes an initial preview, with additional features to be released over time. The AWS library and updates will be available via GetIt, and limited to customers on Enterprise and Architect with active update subscription. Customers using the AWS library also get support by Appercept through Embarcadero’s own support team. The library does not currently support C++Builder, but there are plans to provide C++ support for the AWS SDK in the future. Why An AWS SDK For Delphi Amazon Web Services (AWS) is the world’s leading cloud service today, with well over 50% market share. AWS offers many services, from storage and orchestration to AI services and insights, and it’s leading a transformation in the industry. The availability of an easy-to-use, high-profile AWS SDK for Delphi from Appercept will make it much easier to use AWS cloud services in Delphi client applications, both for desktop and mobile, and will be particularly useful when building server applications, especially if they are deployed in the AWS infrastructure. Closer Look: What to Expect From the Appercept AWS SDK for Delphi The Appercept AWS SDK for Delphi makes heavy use of modern language and framework features, from PPL (Parallel Programming Library) to anonymous methods for async operations, as required by a good REST client framework. This library offers direct mapping to the AWS APIs, starting with a few services like storage (S3) and notifications (SNS) plus a solid support of user accounts and access permissions. Not only does this SDK make the APIs available as direct calls (mapped internally to Delphi’s HTTP client library as needed), it also offers many easy-to-use constructs and data structures, so that the most common AWS operations will require a very limited amount of code while allowing developers to focus on their business logic. The library comes with extensive documentation and demos, making it easy to embrace. It also ships with full source code, enabling users to learn how the solution works and debug it directly within their applications. Want a quick demo? This is all you need to write to have a list of S3 buckets (or folders): uses AWS.S3; var  S3Client: IS3Client; begin  S3Client := TS3Client.Create;  var Response := S3Client.ListBuckets;  for var BucketName in Response.Buckets do    ListBox1.Items.Add(BucketName); uses AWS.S3; var  S3Client: IS3Client; begin  S3Client := TS3Client.Create;  var Response := S3Client.ListBuckets;  for var BucketName in Response.Buckets do    ListBox1.Items.Add(BucketName); What To Do Next If you missed the “Introducing Appercept’s AWS SDK for Delphi” webinar on the 15th of December, you can catch the webinar replay soon after. We’ll post the link here as soon as it’s available. We will also be posting additional information as new features are added and coverage of AWS services grows. For questions, inquiries and additional information please contact me (Marco Cantu).

Read More

5 Ways To Modernize Your Data Access Pipeline

Building database applications with RAD Studio (Delphi & C++ Builder) gives the best experience for developers. For instance, if you want to connect to a database, just drop a database connection component into the project and select the source of the data. Then open the LiveBindings designer and link the database fields to the UI controls and that is it! If you want to connect to a remote database you can make use of the REST Client Library and Rad Studio’s incredibly powerful REST Debugger. Perhaps you need to connect Azure or AWS? That is covered too – just drop the Cloud Connection Provider component. configure it securely, and everything works right away. What sort of topics are covered in this article? We’re going to take a whistle-stop tour through some of the ways using Rad Studio Delphi and C++ builder can make life much easier for developers looking to work with database servers and data. What is FireDAC? How can I convert my programs from the Borland Database Engine BDE to FireDAC? How can I connect to Amazon Web Services and Microsoft Azure with Delphi or C++ Builder? What is the Embarcadero REST Client Library? How do I bind a data source to UI controls in seconds? What is FireDAC? FireDAC is a multi-device data-access library that comes with RAD Studio Delphi and C++ Builder. One thing you can do with FireDAC is talk to SQL databases. You can also make use of an ODBC connection to talk to ODBC data sources.  With its powerful universal architecture, FireDAC enables native high-speed direct access from Delphi and C++Builder to InterBase, SQLite, MySQL, SQL Server, Oracle, PostgreSQL, DB2, SQL Anywhere, Advantage DB, Firebird, Access, Informix, DataSnap, and more, including the NoSQL Database MongoDB. FireDAC features: An enterprise-grade data access engine A unified API Has high-performance Data Access Where can I learn more about using FireDAC? How can I convert my programs from the Borland Database Engine BDE to FireDAC? On the FireDAC page, there is the BDE to FireDAC set of steps that will take you through taking the existing source code, your existing forms in Delphi, and running refined utility which is per-regular expression search and replaces utility. Also, there is a script for migrating BDE that will convert the forms and source code for Delphi into use FireDAC whether it is in data modules on your forms or in your source code for database connectivity.  In general, the FireDAC components have a high compatibility level with the BDE data access components. This includes the syntax and semantics of the properties and methods in the FireDAC and BDE. You can learn some other parts which are different in Migrating BDE Applications to FireDAC. Check out this tutorial to learn more: How can I connect to Amazon Web Services and Microsoft Azure with Delphi or C++ Builder? Delphi & C++ Builder come with Cloud components that allow you to easily utilize cloud services from Amazon Web Services and Microsoft Azure. As you can see, these two core components can be used to connect to AWS or Azure. There is a really helpful sample project called CloudExplorer, that familiarizes you with how to: Initialize Connection Get Selected Account Update Cloud File List Get Selected Cloud File Upload Selected Local File Download Selected Cloud […]

Read More

Why You Should Be Fearless When Developing With Delphi

I keep telling anyone I can, Delphi is superb language for developing applications for all platforms, desktop, mobile or the web. Delphi can make gorgeous apps for the desktop such as Windows, Linux or macOS and yet is just as capable for mobile devices such as iOS and Android. You can create web apps with Delphi – not just simple pages but fully capable involved creations which contain all the power and functionality that is possible on the modern web. But don’t just take my word for it – take a whizz through any of the articles on this blog, watch sessions from DelphiCon 2021 and the Desktop First Summit or visit the wonderful DelphiBooks website and take your pick from the many authors on there. In fact, this year has proven to be a bit of frenzy when it comes to new Delphi books, driven in part by Packt who are fast proving to be major champions of books relating to Delphi. There’s even an updated Delphi Alexandria 11 version of the Delphi must-have Object Pascal Handbook by Marco Cantú which you can download for free. It’s Packt who once again are the publishers behind the most recent addition to the Delphi literary library: Fearless Cross-Platform Development with Delphi by Delphi MVP David Cornelius. As soon as I read chapter rundowns during the run up to the release period, I pre-ordered this book. It was worth every cent. Here’s my review. Why Fearless Cross-Platform Development with Delphi? I only have one issue with David Cornelius’ book “Fearless Cross-Platform Development with Delphi” and it’s the title. This book should have been called something like “how to do almost anything you could ever want with Delphi” because that’s exactly what this book is. A handbook on how to write modern applications using the Delphi language so that they look, work, and behave nicely on almost any computer or device you can think of. It’s an opening opus of quite spectacular proportions. It’s a love story of the power and flexibility of the Delphi language. It’s a gripping tale of diving into a sea of development tasks and possibilities and emerging with the pages dripping with tips, tricks and techniques which cover almost absolutely anything you could want to do as an application developer writing apps that can work on desktops, mobile and even the web. I struggle to believe this is David’s first book. If it is then he must be encouraged by us all, and Packt his publishers, to draw on his skills to write some more. “Fearless Cross-Platform Development With Delphi” takes us on a journey from the basics of using the IDE, Delphi’s integrated development environment, project management tips, through more esoteric topics like the command line compiler. After that whirlwind “this is how to do it” introduction, suitable for newcomers to RAD Studio’s development ecosystem, David goes on to give a brief overview of how Delphi’s Object Pascal language came about, emerging as it did from the likes of Apple Pascal and the greatly-loved Borland Turbo Pascal. He takes care to point out how Delphi has continued to evolve from those early beginnings so that it incorporates a whole range of modern programming language features embracing constructs and capabilities to ensure it not only remains technically competitive […]

Read More

How To Make A Fully Working Slack Bot In Under 10 Minutes

Slack is one of the leading communication platforms for millions of users. You can send instant messages, share documents, share images, and perform many different actions which improve the collaboration between team members. You can also automate and control many outside processes and even smart hardware with Bots in Slack. The best thing of all is you can create Slack bots VERY EASILY using RAD Studio Delphi. What is SDriver? SDriver is a Delphi wrapper for Slack API by Andrea Magni who is one of our fabulous Embarcadero MVP team. SDriver is a free and open-source wrapper for Delphi developers. The best thing is that the wrapper utilizes the native HTTP client libraries for each supported platform – System.Net.HttpClient. SDriver is also implemented with the System. Threading library to work asynchronously. What are the features of SDriver? Compatible with FireMonkey, Visual Component Library, and also Non-visual components Support for Message Attachments Support for Incoming Webhooks Implemented using Native HTTP Client Libraries Async implementation using Parallel Programming Library What are Incoming Webhooks? Incoming Webhooks are a simple way to post messages from apps into Slack. By creating Incoming Webhooks you get a unique URL which you can send a JSON payload with the message text and some options. Andrea’s source code repository contains links to explain this in more depth as does the official Slack website. POST https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX Content-type: application/json { “text”: “Hello, world.” } POST https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX Content–type: application/json {     “text”: “Hello, world.” } implementation {$R *.dfm} uses System.Diagnostics , SDriver.Message, SDriver.Interfaces, SDriver.IncomingWebHook; procedure TForm1.SendActionExecute(Sender: TObject); var LWebHook: IMessageBuffer; LMessage: IMessage; LStopWatch: TStopWatch; begin LStopWatch := TStopWatch.StartNew; LMessage := TMessage.Create(EditMessage.Text + ‘ [‘ + TimeToStr(Now) + ‘]’); LMessage.UserName := EditUserName.Text; LMessage.Icon_URL := EditIcon_URL.Text; LMessage.Icon_Emoji := EditIcon_Emoji.Text; LMessage.Channel := EditChannel.Text; LWebHook := TIncomingWebHook.Create(EditWebHookURL.Text, False); LWebHook.Push(LMessage); LWebHook.Flush; end; procedure TForm1.SendActionUpdate(Sender: TObject); begin SendAction.Enabled := (EditWebHookURL.Text ”) and (EditMessage.Text ”); end; 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 implementation   {$R *.dfm}   uses   System.Diagnostics , SDriver.Message, SDriver.Interfaces, SDriver.IncomingWebHook;   procedure TForm1.SendActionExecute(Sender: TObject); var   LWebHook: IMessageBuffer;   LMessage: IMessage;     LStopWatch: TStopWatch; begin   LStopWatch := TStopWatch.StartNew;     LMessage := TMessage.Create(EditMessage.Text + ‘ [‘ + TimeToStr(Now) + ‘]’);   LMessage.UserName := EditUserName.Text;   LMessage.Icon_URL := EditIcon_URL.Text;   LMessage.Icon_Emoji := EditIcon_Emoji.Text;   LMessage.Channel := EditChannel.Text;     LWebHook := TIncomingWebHook.Create(EditWebHookURL.Text, False);   LWebHook.Push(LMessage);   LWebHook.Flush; end;   procedure TForm1.SendActionUpdate(Sender: TObject); begin   SendAction.Enabled := (EditWebHookURL.Text > ”) and (EditMessage.Text > ”); end; Check out the SDriver now! Do you want to see how fast development with RAD Studio and Delphi can be – why not download a free trial now?

Read More