Delphi

How to Prepare For RAD Studio 11

The RAD Studio 11 release date is fast approaching, and with its support for high DPI screens, a vastly improved user experience and new features for rapid app development, it’s going to change the game for Delphi and C++ developers. Are you and your team ready for the new release? Do you need to prepare at all? What can you do to make the most of this important new release? As Object Pascal and RAD Studio evolve, so should your business. To save you time we’ve put together the most useful suggestions for preparing for the upcoming release of RAD Studio 11. Here they are: 1. Download Marco Cantu’s Free “Object Pascal Handbook” Launch your preparations for RAD Studio 11 by downloading Marco Cantu’s “Object Pascal Handbook” is one of the world’s most popular, thorough and up-to-date books on building apps with Delphi, C++Builder and RAD Studio. It’s also free to download. Get this definitive resource on Object Pascal here: 2. Get Your Free Ticket For The Upcoming “The Desktop First UX Summit 2021” The annual digital event “Desktop First UX Summit” sponsored by Embarcadero Technologies’ RAD Studio, will be held from Monday August 30th, to Friday September 3rd 2021. The Desktop First UX Summit will bring together the brightest minds in UX for panel discussions and webinars around desktop UX. Attendees will have access to content around their favorite development tools and general content on effective User Interface Design and good User Experience. Helping developers prepare their applications for the upcoming release of Windows 11 will also be an important theme, and there will be an early preview of RAD Studio 11. Click here or on the image to register free and save your seat. 3. Take Advantage of Our Promo Offer We have a very special early-bird offer created uniquely for the RAD Studio 11 release. It’s a great opportunity to 1) get the 10.4.2 edition of Delphi, C++Builder or RAD Studio at a discount and 2) prepare your systems for the free upgrade to RAD Studio 11. This means you will not only get the full-featured latest version of any of these IDEs today for a discount, you will also get a two-month extension on your license, which means you will automatically get the new edition, RAD Studio 11, when it is released. The 10.4.2 version is already compatible with the M1 Mac Mini and WIndows 11, so you’re all set from the get-go for the most advanced tech coming out today. We’ve done everything we can to make it easy for you to upgrade your software to the latest editions and benefit from their newest features. What else is there to do? Act Now and Save Big! Jump to the RAD Offer Page 4. Get InterBase Why should you try InterBase? InterBase is Embarcadero’s award-winning SQL database, and it’s a data security and management powerhouse that comes free with RAD Studio. If you haven’t deployed it already, and even if you are currently using a different solution, it pays to give InterBase a try. Its Change Views data tracking technology, which has won an IoT award, its advanced security and encryption capabilities, and the ability to embed and encrypt your data on your device, are features well worth considering for your business. Download the free Developer […]

Read More

Everything You Need To Build A Website Scraping App

The ScrapeStack API was built to offer a simple REST API interface for scraping web pages at scale without having to programatically deal with geolocations, IP blocks or CAPTCHAs. The API supports a series of features essential to web scraping, such as JavaScript rendering, custom HTTP headers, various geo-targets, POST/PUT requests and an option to use premium residential proxies instead of datacenter proxies. In this article we will see how fast and easy it is to use RAD Studio and Delphi to create a Firemonkey multidevide application using the LowCode Wizard in addition to a REST client library to take advantage of ScrapeStack API and retrieve a JSON format response for Website Scrape 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 ScrapeStack API? Make sure you refer to ScrapeStack API website – https://ScrapeStack.com/ – and SignUp 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 Quickstart 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 ScrapeStack API endpoints? Now all we need to do is to call the API base URL http://api.scrapeStack.com/ via a HTTP POST method with no JSON request body needed and some few requested parameters added to the URL address depending on the endpoint we choose to call. One can do that using REST Client libraries available on several programming languages. scrapeStack offers a single endpoint to scrape whatever webpage you want. For a complete and detailed information on endpoint and its parameters make sure you refer to ScrapeStack Quickstart guide at https://scrapeStack.com/quickstart // Scrape web page by providing a URL http://api.scrapestack.com/scrape ? access_key = YOUR_ACCESS_KEY & url = https://apple.com // optional parameters: & render_js = 0 & keep_headers = 0 & proxy_location = us & premium_proxy = 0 // more parameters available please refer to the API Documentation (https://scrapeStack.com/documentation) // Scrape web page by providing a URL http://api.scrapestack.com/scrape ? access_key = YOUR_ACCESS_KEY & url = https://apple.com   // optional parameters: & render_js = 0 & keep_headers = 0 & proxy_location = us & premium_proxy = 0 // more parameters available please refer to the API Documentation (https://scrapeStack.com/documentation) What does the ScrapeStack API endpoint return? After the call the main results will be the complete scrape of the website that you provided in the parameter URL. In this case we provided Embarcadero’s website https://www.embarcadero.com – part of the result is shown in the screenshot below. How do I connect my Delphi applications to ScrapeStack API? Once you have followed basic steps to set up the ScrapeStack API we need to make sure we are able to connect and communicate with it before we start writing some code. RAD Studio Delphi and C++Builder make it very easy to connect to APIs as you can you REST Debugger to automatically create the REST components and paste them into your app. In Delphi all the job is done using 3 components tot make the API call. They are the TRESTClient, TRESTRequest, and TRESTResponse. Once you connect the […]

Read More

How To Make An App To Convert IP to Geolocation

Wouldn’t it be nice to know where your customers access your website from and customize user experiences based on IP?! ipstack offers a powerful, real-time IP to geolocation API capable of looking up accurate location data and assessing security threats originating from risky IP addresses. Results are delivered within milliseconds in JSON or XML format. Using the ipstack API you will be able to locate website visitors at first glance and adjust your user experience and application accordingly. 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 ipStack API and retrieve a JSON format response for IP to geolocation in real-time. ipstack API has years of partnership with large ISPs ensure accurate and consistent data any day of the year and covers over 2 million unique locations in more than 200.000 cities around the world. 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 IpStack API? Make sure you refer to IpStack API website (https://IpStack.com/) and and SignUp 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 Quickstart 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 IpStack API endpoints? Now all we need to do is to call the API base URL (http://api.ipStack.com/) 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. ipStack offers three API endpoints to choose from: Standard Lookup: Look up the data behind an IP address. Bulk Lookup: Look up the data behind multiple IP addresses at once. Requester Lookup: Look up the data behind the IP address your API request is coming from. Our demo will focus on the Standard Lookup 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 IpStack Quickstart guide (https://ipStack.com/quickstart) // Standard IP Lookup – look up the data behind an IP address http://api.ipstack.com/134.201.250.155 ? access_key = YOUR_ACCESS_KEY // optional parameters: & fields = ip,location,security & hostname = 1 & security = 1 & language = en & callback = MY_CALLBACK & output = json // more parameters available please refer to the API Documentation (https://ipStack.com/documentation) // Standard IP Lookup – look up the data behind an IP address http://api.ipstack.com/134.201.250.155 ? access_key = YOUR_ACCESS_KEY   // optional parameters: & fields = ip,location,security & hostname = 1 & security = 1 & language = en & callback = MY_CALLBACK & output = json // more parameters available please refer to the API Documentation (https://ipStack.com/documentation) What does the IpStack API endpoint returns? After the call the main results will be as shown below. {“ip”:”35.208.128.246″, “type”:”ipv4″, “continent_code”:”NA”, “continent_name”:”North America”, “country_code”:”US”, […]

Read More

Desktops Are An Unmatched Productivity Powerhouse

Mobile apps may be in vogue but with the global pandemic disrupting workplaces everywhere desktop devices bring the office to wherever you are working from this week. Microsoft has reported there are over 1.3 billion devices running Windows 10 and they are working on shipping Windows 11. Some work can be done on just a mobile device but for other information economy activities such as software development, graphic design, and global finance there is no better place to be productive than on your favorite desktop device. In this article we are going to explore how desktop devices have a productivity edge that has been honed over the decades. Does having multiple monitors make you more productive? Repeatedly, studies over the years have shown that having multiple monitors increases productivity. While some mobile devices support large screens or even multiple screens that is not the normal configuration most people use. Desktops (and laptops), on the other hand, generally have a large primary display screen and in addition the devices ship frequently with multiple monitor support built into the motherboard. To learn more about taking full advantage of the desktop UI and UX experience you can get a free ticket for Desktop UX Summit 2021 where the focus is on a “desktop first” experience, what is meant by that and why it’s important. Does using hot key combinations make you more productive? CTRL-C and CTRL-V on Windows are tried and true key combinations for copying and pasting content. Hot keys like this on a keyboard give you a productivity boost over using the same function via the mouse or a touch screen. Software development tools like Embarcadero RAD Studio have built in support for building your own custom keyboard combinations into your apps. In addition to TShortcut, system wide accelerator keys can be configured to enhance productivity. Can adding peripherals make you more productive? Desktop and laptop computers have been around for decades and there are many different kinds of peripherals that have been created for them. Everything from special mice to joysticks to drawing pads to custom instruments and ever smart phones themselves. Specifically, as one example, for graphic design work, drawing pads, or large screened mobile devices connected to a desktop can significantly boost productivity. Not only can peripherals be added to laptop and desktop devices but multiple peripherals can be added all at the same time to a single machine. You could even connect more than one smart phone device to a desktop computer for syncing and management. There are multiple software libraries for Embarcadero RAD Studio that offer direct access to all these types of peripherals. Does app size really matter? Networks and hard drives are fast these days. Despite this the size of your app still matters in this context. Embarcadero Delphi can create a graphical application for Windows devices that is roughly 2MB in size. That is smaller than some web pages! You can read an analysis of such an application in our Delphi vs. WPF vs. Electron comparison. This small-sized executable is easily copied over the network or even executed across the network. Additionally, it has no dependencies! Large mobile device applications, sometimes hundreds of megabytes these days, even at 4G speeds can take significant time to download on a mobile device. Waiting for a […]

Read More

What Is It Like To Be A Developer Sunil Kumar Arora?

Hello. This article is part of a new 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. Today we’re talking to Sunil Kumar Arora also known as “Digitiger”. Sunil is a based in Shillong, Meghalaya, India. He is an Embacadero MVP and long-time Delphi developer. Hello Sunil, thanks for talking to us. Thank you for the opportunity. Could you tell us a little about yourself? I think of myself as one who continues to attempt to travel the road less traveled, and step out of comfort zones, time and again. Still a child at heart who enjoys fantasizing & also passionate to learn pure and rational sciences, my real professional journey has its roots in Software development, Sales & Marketing and above all managing and nurturing relations of all sorts. I think I am an analytical, insightful, & highly disciplined problem solver with a demonstrated ability to identify & secure project resources & provide the quality leadership that invokes committed professional participation from all involved. Maintaining meticulous attention to detail, inspiring team accomplishment, & delivering quality, on-time project execution are areas in which I am reported to excel. As much as I care about human relations, I feel that the approach to work and quality of work is equally important. I have had accountability for the design, implementation, and execution of development / Support projects for all technological platforms including SMAC. During that time, I have developed a solid reputation for successfully and profitably managing numerous concurrent projects through all project phases from conception through completion within targeted cost, schedule, and compliance parameters. Sustaining a high-performance reputation, maintaining quality standards, and minimizing corporate costs and liability have been a consistent result of my professional commitment. Last but not the least, my empathy and compassion also drives me to voluntarily remain engaged as a social worker through several organizations/NGOs including FOMI (Friends of Mentally Ill), Rotary Club of Shillong and many others. Which Embarcadero product(s) do you use a) the most b) regularly? Even though I use RAD Server, Interbase and so on, Delphi has been the most regularly used Embarcadero product I have been using since very long. In fact, I started using Delphi with version 2 sometime around 1996 if my memory serves me right. How and/or why did you become a developer? You may laugh but as a matter of fact I feel my two main habits / likings are the main reasons for me becoming a developer. One is my passion for creativity and second is my laziness. Because I love to be creative but also like to get things done in easiest possible with least efforts or confusion so becoming a software developer perhaps was most logical option. Do you think you will ever stop being a developer? If so, what would be next? I do not think that in real sense there would be a full stop till the time my brain is working, yes, the quantum would surely decrease sooner or later. In fact, if I compare quantum of work or time spent by me in development related activities say about ten years back with what I do now, it […]

Read More

Made With Delphi: This Powerful Load Shedding Schedule App

This beautifully designed and engineered app really puts the superb cross-platform capabilities of the Delphi FireMonkey FMX platform to work on mobile devices running either Android or iOS. Delphi keeps South Africans forewarned of potential electrical outages Eskom is a South African public utility supplying both commercial premises and regular consumers with electricity. At times of extreme demand it is sometimes necessary for Eskom to use “load shedding”. Load shedding is a procedure where the electricity supplier tries to prevent the power delivery circuits from incurring damage due to overloading. Overloading is really quite simple: the amount of electricity which can be generated and safely delivered is finite. Apart from the obvious physical output limitation on the generators themselves, powerlines to deliver that electricity also have a maximum capacity before they will become damaged by overheating and sometimes, in extreme cases, catching fire or exploding. When the amount of electricity being used by consumers reaches the point where it is unsustainable and is approaching that point where an overload could happen the electricity generating company will actually temporarily cut off the power to selected regions for the greater good of the overall client base. This reduces the load and in turn averts disaster. Knowing if your power is going to be disconnected can save lives Obviously, in our high tech world, electricity is the lifeblood of much of modern life. Not just for entertainment such as TVs, games consoles, and computers but, in hotter countries, the air-conditioning is vital. If the air conditioning stops working the inability to cool down can actually result in heat-related sickness and even deaths. Likewise, some private consumers can have other electrical devices like CPAP machines, home kidney dialysis units and other similar medical appliances which operate on electricity and without it can lead to life-threatening and potentially fatal situations developing. Obviously electrical outages are inconvenient at best and seriously impacting or disastrous at worst. A planned outage or least some forewarning of the outage and, better still, a heads-up on when power will be restored can take much of the danger out of electrical disconnections and provides those likely to be affected with some space to take steps to mitigate the problems that might occur. GTM’s Delphi app can genuinely help avoid danger, reduce frustration and prevent a drama becoming a crisis In the words of the developer: “The GTM loadshed app will take all the confusion out of the Greater Tzaneen Municipality’s load shedding schedule”. According to GTM, the app’s features include: – By defining your area the app will tell you if you are subject to load shedding or not.– Indicates whether Eskom is load shedding and, if so, at which stage.– Receive notifications on Eskom stage changes as well as your area’s load shedding status.– Receive notifications when your area’s load shedding is about to start.– Provides contact information for GTM for power related queries. Developer Website GTM LoadShed Google Play GTM  Apple App Store GTM Screenshot Gallery

Read More

Protect Your App With This Free Anti-Hacking Tool In 2021

Hackers around the world are using advanced tools to abuse your source code They can extract sensitive information from your application and cause major financial damage. So, it can be very important to obfuscate your Delphi program. It will make the code very difficult to analyze for the hackers. So, they can’t abuse or add malicious functions to your application. In this post, you will find the details of obfuscating the Delphi programs with an open-source Delphi code obfuscator, called Pythia. This a new Delphi code obfuscator tool for 2021 We have written about code obfuscators before on this blog, both for Delphi code obfuscation and to protect C++ apps from reverse-engineering too. Both of those options were slightly more mature commercial solutions which some commenters said they were not happy with since, although perfectly usable, they believed that they were a little out of date and for a paid product that was a problem. Well, this article is about a code obfuscation tool which is Open Source so you can see exactly what and how it does in the work of obfuscation. Yes, the code is also from a few years back (if it works without bugs, why change it?) – however, because it’s Open Source you can also examine the code, fork the repository, and make improvements or change the way the obfuscation works to create your own unique custom obfuscation which would then further thwart reverse engineering. What is an open-source Delphi Code Obfuscator? Open-source Delphi code obfuscator is a free tool that makes your code complex by adding an extra layer of obfuscation. As a result, the hackers will have a very tough time comprehending your program. So, they can’t steal sensitive data from your application. Also, they can’t reverse engineer your code. Why should you use an open-source Delphi Code Obfuscator? Helps you to save money Hides sensitive information by generating random values Protects intellectual property or trade secrets from the hackers What is the best open-source Delphi Code Obfuscator in 2021? The best open-source Delphi code obfuscator in 2021 is Pythia. It is available for free. The license used means you can use it with the code of your commercial Delphi applications without spending any money. Also, you can alter and redistribute Pythia freely within the guidelines of the original license. How Pythia Protects Your Delphi Program Pythia protects your program by modifying the Delphi Form (DFM) data and Virtual Method Tables (VMT) data of existing binary files in such a way that it’s rendered useless for hackers. However, it doesn’t change the functionality of your program. It keeps everything the same while obfuscating the key information. So, any person attempting to reverse engineer your program will face a very difficult time. Let’s take a look at an example. Before Obfuscation: Take a look at StringGrid1 of the DFM Data tree. It has a property, called Left. What will happen when it is obfuscated? After Obfuscation: As you can see, StringGrid1 has been changed to NzJaIGRG5Hb. Also, the Left property has been changed to BTtK. By obfuscating the data, Pythia is helping you to conceal important values. So, hackers can’t steal key information. Should I use Pythia? Pythia helps you to obfuscate binaries created with Delphi. As a result, your competitors and the lurking […]

Read More

How To Use A C++ DLL In Any Delphi Program

There is a glorious wealth of useful C++ libraries available on the internet. We have featured many great uses of C++ here on this blog too. C++ is typically extremely high performance. If we can have the source code of the C++ library, we can create a package which will then allow us to use the C++ in our Delphi programs. Often though the source code of the C++ library is not available. In commercial C++ libraries, it is common to get only a few C++ headers and the static library file (.lib) without any of the accompanying .cpp source files. So, in this case, when we want to use those C++ libraries in our Delphi application, we can use a Proxy DLL to make it possible. How to create a Proxy DLL to connect C++ DLL and Delphi? To connect Delphi to a DLL, the DLL should expose a simple Windows API style API instead of C++ things. We can use any of the C++ compilers to compile the Proxy DLL. Embarcadero Dev-Cpp Open Source Compiler Visual Studio Let’s take a simple example. Let’s think we have a DLL file and a harder file with this declaration and no .cpp file with the implementation. You can refer to the source code of this example in this link: https://github.com/PacktPublishing/Delphi-High-Performance/tree/master/Chapter%208/StaticLib1 #pragma once class CppClass { int data; public: CppClass(); ~CppClass(); void setData(int); int getSquare(); }; #pragma once class CppClass {   int data; public:   CppClass();   ~CppClass();   void setData(int);   int getSquare(); }; Here’s how to use a C++ library in a Delphi program with a proxy dll Now we need to create the proxy DLL. Create a new C++ DLL project with your preferred IDE. It will automatically add “dllmain.cpp” file. But we need another unit to wrap the static library. Add new unit called “StaticLibWrapper.cpp”. Now we should include the header file of the static library we want to import in our project. #include “stdafx.h” #include “CppClass.h” #include “stdafx.h” #include “CppClass.h” Now copy the header file of the static library to the project folder. Now we should include the static library in our project. To do that add the static library folder to the library directories: Or in Visual Studio goto “Configuration Properties | Linker | General | Additional Library Directories settings”. How to mark C++ DLL functions as “exported” Now we define a Macro to mark DLL functions are exported. #define EXPORT comment(linker, “/EXPORT:” __FUNCTION__ “=” __FUNCDNAME__) #define EXPORT comment(linker, “/EXPORT:” __FUNCTION__ “=” __FUNCDNAME__) Next, implement the IndexAllocator class to cache the C++ objects. This class contains an array of pointers. It has three functions as “Allocate”,  “Release” and “Get” to store the pointer in the cache, release the cache, and get a pointer by index. bool Allocate(int& deviceIndex, void* obj) bool Release(int deviceIndex) void* Get(int deviceIndex) bool Allocate(int& deviceIndex, void* obj) bool Release(int deviceIndex) void* Get(int deviceIndex) Then we need to Initialize and Finalize functions to allocate and deallocate IndexAllocator objects. extern “C” int WINAPI Initialize() extern “C” int WINAPI Finalize() extern “C” int WINAPI Initialize() extern “C” int WINAPI Finalize() Then we create an instance of CppClass class and store it in the cache with this function. extern “C” int WINAPI CreateCppClass (int& index) extern “C” int WINAPI CreateCppClass (int& index) In this statement, we use “C” to make sure the same name is exported and […]

Read More

Made With Delphi: This Brilliant Soccer Strategy Mobile App

The game of soccer is deceptively simple; guide the ball, using only your feet or head, and try to get it into your opponent’s net. Yet that simple set of instructions belies a game of great skill and cunning strategy worthy of any Army general or chess grandmaster. To get that leather sphere pounding in the back of the net requires guile and an understanding of physics and innate geometry combined with hand-to-eye coordination and a substantial level of fitness from the players. It may be called “the beautiful game” but it’s also the fiendishly frustrating game too. A Delphi mobile app for soccer coaches With Soccer Playview coaches and players can view animated plays, drills and practice plans on their cell phone or tablet. Soccer plays, drills and practice plans can be created with the Soccer Playbook program from Jes-Soft, which is free to try and available at http://www.jes-soft.com/soccer/index.html. We’ve featured other apps from Jes-Soft before and how they’ve really put the cross-platform capabilities of RAD Studio Delphi’s FMX FireMonkey framework to excellent use. The app allows users to create strategic ‘plays’ and practice plans on their desktop computers. These can then be saved to a cloud drive such as G-Drive or DropBox. The saved plays can then be opened on the mobile device from those cloud locations. It’s a real shining example of Jes-Soft’s skills but also the true power and overwhelming flexibility of Delphi and FireMonkey. Website Soccer Playview Google Play Soccer Playview Screenshot Gallery RAD Studio is the power behind Jes-Soft’s superb app. It allows them to realize their creativity and bring their app to market, reliably and affordably. Why not download a free trial copy of RAD Studio today and see what it can do for you?

Read More

How To Create A Cross-Platform News App With Delphi

procedure TNewFormFrame.BtnRefreshClick(Sender: TObject); begin   inherited;   RESTRequest1.Execute;  // send request to endpoint     var JSONValue: TJSONValue;   var JSONArray: TJSONArray;   var ArrayElement: TJSONValue;     // after using object we just free them within the Lists   RctList := TList.Create;   ImgList := TList.Create;   LblTitleList := TList.Create;   LblDescpList := TList.Create;     try     JSONValue := TJSONObject.ParseJSONValue(RESTResponse1.Content);     JSONArray := JSONValue.GetValue(‘data’);  // articles are stored in the data array in the JSON response       for ArrayElement in JSONArray do     begin         {$region ‘Create news card’ }       RctNewsCard := TRectangle.Create(vrtscrlbx1);       RctNewsCard.Parent := vrtscrlbx1;       RctNewscard.HitTest := False;       RctNewsCard.Fill.Color := TAlphaColorRec.Ghostwhite;       RctNewsCard.Fill.Kind  := TBrushKind.Solid;       RctNewsCard.Stroke.Thickness := 0;       RctNewsCard.Align := TAlignLayout.Top;       RctNewsCard.Height := 400;       RctNewsCard.Width  := 389;       RctNewsCard.XRadius := 15;       RctNewsCard.YRadius := 15;       RctNewsCard.Margins.Top := 5;       RctNewsCard.Margins.Bottom := 5;       RctNewsCard.Margins.Left := 5;       RctNewsCard.Margins.Right := 5;       RctList.Add(RctNewsCard);  // add to the TList instance       {$endregion}         {$region ‘create image and load image from the url’ }       NewsImage := TImage.Create(RctNewsCard);       NewsImage.Parent := RctNewsCard;       NewsImage.HitTest := False;       NewsImage.Align := TAlignLayout.Top;       NewsImage.Height := 225;       NewsImage.Width  := 389;       NewsImage.Margins.Top := 5;       NewsImage.Margins.Left := 15;       NewsImage.Margins.Right := 15;       NewsImage.Margins.Bottom := 5;       NewsImage.HitTest := False;       NewsImage.MarginWrapMode := TImageWrapMode.Stretch;       NewsImage.WrapMode := TImageWrapMode.Fit;       ImgList.Add(NewsImage);         // load images to the newly created TImage component       var MemoryStream := TMemoryStream.Create;       var HTTPClient   := TNetHTTPClient.Create(nil);       var HTTPRequest  := TNetHTTPRequest.Create(nil);       HTTPRequest.Client := HTTPClient;       try         var ImageURL := ArrayElement.GetValue(‘image’);         HTTPRequest.Get(ImageURL, MemoryStream);         MemoryStream.Seek(0, soFromBeginning);         NewsImage.Bitmap.LoadFromStream(MemoryStream);       finally         FreeAndNil(MemoryStream);         FreeAndNil(HTTPClient);         FreeAndNil(HTTPRequest);       end;       {$endregion}         {$region ‘create title and summary texts in the News Card’ }       LabelTitle := TLabel.Create(RctNewsCard);       LabelTitle.Parent := RctNewsCard;       LabelTitle.Align := TAlignLayout.Top;       LabelTitle.Height := 27;       LabelTitle.Width  := 359;       LabelTitle.HitTest := False;       LabelTitle.AutoSize := True;       LabelTitle.Font.Size := 22;       LabelTitle.Margins.Left := 15;       LabelTitle.Margins.Right := 15;       LabelTitle.Margins.Top := 5;       LabelTitle.Margins.Bottom := 5;       LabelTitle.Text := ‘Title: ‘ + ArrayElement.GetValue(‘title’);       LblTitleList.Add(LabelTitle);         LabelDescription := TLabel.Create(RctNewsCard);       LabelDescription.Parent := RctNewsCard;       LabelDescription.Align := TAlignLayout.Client;       LabelDescription.Height := 131;       LabelDescription.Width  := 359;       LabelDescription.HitTest := False;       LabelDescription.AutoSize := True;       LabelDescription.Font.Size := 15;       LabelDescription.Margins.Left := 15;       LabelDescription.Margins.Right := 15;       LabelDescription.Margins.Top := 5;       LabelDescription.Margins.Bottom := 5;       LabelDescription.Text := ‘Summary: ‘ + ArrayElement.GetValue(‘description’);       LblDescpList.Add(LabelDescription);       {$endregion}     end;   finally     RctList.Free;     ImgList.Free;     LblTitleList.Free;     LblDescpList.Free;   end; end;

Read More