RAD-in-Action Webinar – Unit Testing in Delphi

RAD-in-Action Webinar  - Unit Testing in Delphi

You’re invited to join Embarcadero and Delphi programming expert and author, Nick Hodges, for an in-depth look at unit testing in Delphi.

Without unit tests your code is fragile, hard to change, and unreliable. Unit testing is the only way that you can be sure that your code does what it is supposed to do.

In this webinar, Nick discusses the basics of Unit Testing as well as providing a demo that illustrates the points at hand using the new DUnitX framework. This will lead to a discussion of stubs and mocks, and the use of the DelphiMocks framework to ensure that all your classes are tested in isolation.

Click on the image to join

Yes!! RAD Studio C ++ in testThis time we’re going to perform a similar set of tests for Windows.

Yes!! RAD Studio C ++ in testThis time we're going to perform a similar set of tests for Windows.

This time we’re going to perform a similar set of tests for Windows.
One notable aspect of using C++ on Windows is you’re typically encouraged to use an IDE such as Microsoft Visual Studio, or else a competing-style IDE such as one from Embarcadero called RAD Studio (which came up from the ashes of the old Borland products, Delphi and C++ Builder). Although it can also be used in a standalone fashion, the Intel compiler integrates into Visual Studio (but not the free Express versions of Visual Studio); there are also some very nice, free IDEs such as CodeLite and Code::Blocks. But to perform tests of the compilers themselves, I removed the IDE variable in favor of focusing only on the command line.

full article click on the image

Delphi XE5 HotFix 4 has new reFind

Delphi XE5 HotFix 4 has new reFind

Embarcadero has released hotfix 4 for Delphi, C++Builder and RAD Studio XE5 Update 2. It contains the updated reFind that was supposed to ship in Update 2.
Embarcadero has released hotfix 4 for Delphi, C++Builder and RAD Studio XE5 Update 2. It contains the updated reFind that was supposed to ship in Update 2.

Form the readme: “This Hotfix provides an updated reFind.exe which can be found in the bin folder. This version of reFind.exe is 2.5. Additional features include unit names replacements, required by the BDE conversion demo script included among XE5 Update 2 demos.”

Click on the image and download

Sharing images and data on mobile

Sharing images and data on mobile

I recently got a question on my blog on how to use the ShareSheet implementation on iOS and Android in code instead of using the built-in actions.

Using the built-in ShareSheet action, it only takes one line of code to share an image (or text) in your FireMonkey mobile app.

Here is a simple example using actions. You can download the code snippet here.

procedure TShareSheetForm.ShowShareSheetAction1BeforeExecute(Sender: TObject);
begin
{ show the share sheet }
ShowShareSheetAction1.Bitmap.Assign(imgCameraPicture.Bitmap);
end;

Here is how you can use ShareSheet to share images or text in your application without using the built-in actions:

unit MainFrm;

interface

uses
System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, FMX.StdCtrls, FMX.Layouts, FMX.Objects, FMX.Edit;

type
TForm1 = class(TForm)
Edit1: TEdit;
Image1: TImage;
SwitchSendText: TSwitch;
SwitchSendImage: TSwitch;
Button1: TButton;
Layout1: TLayout;
Layout2: TLayout;
Label1: TLabel;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

uses
FMX.Platform, FMX.MediaLibrary;

{$R *.fmx}

procedure TForm1.Button1Click(Sender: TObject);
var
ShareSheetService: IFMXShareSheetActionsService;
SharedText: string;
SharedImage: TBitmap;
begin
if TPlatformServices.Current.SupportsPlatformService(IFMXShareSheetActionsService, IInterface(ShareSheetService)) then
begin
if SwitchSendText.IsChecked then
SharedText := Edit1.Text
else
SharedText := ‘ ‘;

if SwitchSendImage.IsChecked then
SharedImage := Image1.Bitmap
else
SharedImage := nil;

{ Share Data}
ShareSheetService.Share(Button1, SharedText, SharedImage);
end;
end;
end.