Quantcast
Channel: IOS | Delphi XE8 10 Seattle Berlin Tokyo Rio Sydney Firemonkey, Delphi Android, Delphi IOS
Viewing all 75 articles
Browse latest View live

Developer Guide For The FireMonkey Hospitality Survey App Template In Delphi 10.2 Tokyo

$
0
0

The Hospitality Survey App template that Embarcadero has released for Delphi 10.2 Tokyo through their GetIt platform is quite extensive. I have put together a developer guide video for the project which explains more in depth. The video explains each of the four different projects that make up the Hospitality Survey App. These projects include:

A client app built with FireMonkey for Android, IOS, OSX, and Windows where users can fill out survey information.

A web app built with AngularJS for viewing survey stats. There is a second version of the web app built in Sencha which will also be available.

A REST server built with RAD Server for Windows and Linux.

And a setup app which is used to configure the whole system.

Lastly you can customize the questions during the setup process and also in real time using the Hospitality Survey Editor.

Check out the full developer guide video below to get started!


Cross Platform Activity Progress Dialog For Android, iOS, macOS, and Windows In Delphi 10.2 Tokyo

$
0
0

The Hospitality Survey Client project is part of the Hospitality Survey App template for Delphi 10.2 Tokyo that Embarcadero has released through their GetIt platform. The Hospitality Survey App consists of four different projects. In this blog post I will cover the progress/activity dialog TFrame that is built into the Hospitality Survey Client project.

The progress/activity functionality is built as a TFrame and then included in the Main Form and set to Align := Contents. Align := Contents means that it ignores all of the other aligned elements and just fills it’s parent container (which in this case is the Main Form). Inside of the TFrame there is a semi-transparent background rectangle to cover the entire interface under the TFrame and then there is a TCircle in the center of the TFrame. Inside of the TCircle is a second smaller TCircle and a TArc component.

The TArc component has a 90 degree arc which fills in the space between the two circle (see the diagram). A TFloatAnimation component on the TArc allows it’s RotationAngle property to animation and the end result is that the TArc spins around in between the two TCircles creating a nice looking progress/activity dialog. You can see on the TFloatAnimation component that the StartValue is 0 and the StopValue is 360.

Throughout the app where it needs to show a “working” dialog and disable the user interface it calls ShowActivity (see below) before starting the long operation and then when the long operation is complete it calls HideActivity.

procedure TMainForm.ShowActivity;
begin
  MultiView.Enabled := False;
  ProgressFrame.ShowActivity;
end;
 
procedure TMainForm.HideActivity;
begin
  ProgressFrame.HideActivity;
  MultiView.Enabled := True;
end;

Inside the TProgressFrame these two functions Show and Hide the TFrame and enable/disable the animation.

procedure TProgressFrame.ShowActivity;
begin
  Self.Visible := True;
  ProgFloatAnimation.Enabled := True;
end;
 
procedure TProgressFrame.HideActivity;
begin
  ProgFloatAnimation.Enabled := False;
  Self.Visible := False;
end;

 

And that’s all there is to it. There is no other code to write. This responsive progress/activity dialog should work across Android, iOS, macOS, and Windows.

If for whatever reason you need a platform native dialog for Android and iOS you can check out the TfgProgressDialog and TfgActivityDialog components in the FGX component set over on Github. You could also combine the native dialogs with the TFrame dialog mentioned above to get coverage across all 4 platforms (native dialogs on Android/iOS and then FMX dialogs on Windows and macOS).

Generate Cross Platform Dynamic Forms At Runtime From JSON In Delphi 10.2.1 Tokyo

$
0
0

The Hospitality Survey Client project is part of the Hospitality Survey App template for Delphi 10.2.1 Tokyo that Embarcadero has released through their GetIt platform. The Hospitality Survey App consists of four different projects. In this blog post I will cover the dynamic form generator that is built into the Hospitality Survey Client project. Also keep in mind that the client can be deployed to Android, iOS, macOS, and Windows with a single code base and a single responsive UI.

Basically how it works is on the server there is a database table which contains the list of survey questions to be asked to patrons from each tenant (in this case restaurant). The /survey/ end point in RAD Server is called from TBackendEndpoint (which is basically a TRESTClient) in the Survey App Client. The RAD Server end point returns the contents of the Questions table as the FireDAC JSON format. You can customize the questions using the Hospitality Survey Editor. The Client saves out the FireDAC JSON to a surveys.json file which is then loaded into an TFDMemTable. The GenerateSurvey() function (see below) loops through the records in the TFDMemTable and creates a TFrame for each record. Each record corresponds to a question in the database and you can see the different fields in a record below:

  • ID – An ID for the question.
  • name – A short name for the question with no spaces.
  • title – The text of the question as it will appear in the survey.
  • type – The type of question controls which question template is loaded on the client. The existing types are: rating, yesno, edit, options
  • options – If the type of the question is set to options this field is used to populate the options. It’s value is a JSON array of options.
  • value – The value is where the user submitted data is stored. It can be left blank but could be used to provide a default answer.
  • category – The category of the question. This field is provided for expandability.
  • tenant_id – The tenant ID of the question. If the tenant_id field is blank all tenants will get the question. If it is set to a tenant only that tenant will get the question.

The Type column determines which TFrame is loaded for that record. The built in types are: rating, yesno, edit, options. You can add your own row types as well by modifying the GenerateSurvey() procedure. You can see the units below for each of the dynamic TFrames including a header frame and a complete button frame for submitting the form.

  • uSurveyHeaderFrame.pas – Contains the header for the top of the survey.
  • uRatingBarFrame.pas – Contains the star rating track bar survey question type.
  • uYesNoFrame.pas – Contains the Yes/No survey question type.
  • uEditFrame.pas – Contains the edit survey question type.
  • uComboBoxFrame.pas – Contains the combo box survey question type.
  • uCompleteFrame.pas – Contains the complete button for the survey.

The GenerateSurvey() procedure itself is pretty simple. It loops through the TFDMemTable dataset and checks the type field to see which TFrame to load and populate for that record. The options field is a JSON array that is used to populate the values for the yesno type and options type. The ID field is used to mark the TFrame with the specific question it was created from (FrameItem.Tag := BindSourceDBForm.DataSet.FieldByName(‘ID’).AsInteger;) so that the value field can be filled out with the answer from the user.

//
procedure TMainForm.GenerateSurvey(Sender: TObject);
var
  FrameItem: TFrame;
  FieldType: String;
  FieldCategory: Integer;
  JSONArray: TJSONArray;
  I: Integer;
begin
  FrameItem := TSurveyHeaderFrame.Create(TFMXObject(Sender));
  FrameItem.Parent := TFMXObject(Sender);
  FrameItem.Name := 'FSurveyHeader';
  FrameItem.Align := TAlignLayout.Top;
  FrameItem.Position.Y := 0;
 
  BindSourceDBForm.DataSet.First;
  while not BindSourceDBForm.DataSet.Eof do
  begin
    FieldCategory := BindSourceDBForm.DataSet.FieldByName('category').AsInteger;
 
      FieldType := BindSourceDBForm.DataSet.FieldByName('type').AsString;
      if FieldType = 'edit' then
      begin
        FrameItem := TEditFrame.Create(TFMXObject(Sender));
        FrameItem.Parent := TFMXObject(Sender);
        TEditFrame(FrameItem).QuestionText.Text :=
          BindSourceDBForm.DataSet.FieldByName('title').AsString;
      end;
      if FieldType = 'yesno' then
      begin
        FrameItem := TYesNoFrame.Create(TFMXObject(Sender));
        FrameItem.Parent := TFMXObject(Sender);
        TYesNoFrame(FrameItem).QuestionText.Text := BindSourceDBForm.DataSet.FieldByName('title').AsString;
        JSONArray := TJSONObject.ParseJSONValue(BindSourceDBForm.DataSet.FieldByName('options').AsString) as TJSONArray;
        for I := 0 to JSONArray.Count - 1 do
        begin
          case I of
            0:
              begin
                TYesNoFrame(FrameItem).ValueSpeedButton1.Text := JSONArray.Items[I].Value;
                TYesNoFrame(FrameItem).ValueSpeedButton1.GroupName := BindSourceDBForm.DataSet.FieldByName('name').AsString;
              end;
            1:
              begin
                TYesNoFrame(FrameItem).ValueSpeedButton2.Text := JSONArray.Items[I].Value;
                TYesNoFrame(FrameItem).ValueSpeedButton2.GroupName := BindSourceDBForm.DataSet.FieldByName('name').AsString;
              end;
          end;
        end;
        JSONArray.Free;
      end;
      if FieldType = 'rating' then
      begin
        FrameItem := TRatingBarFrame.Create(TFMXObject(Sender));
        FrameItem.Parent := TFMXObject(Sender);
        TRatingBarFrame(FrameItem).QuestionText.Text := BindSourceDBForm.DataSet.FieldByName('title').AsString;
      end;
      if FieldType = 'options' then
      begin
        FrameItem := TOptionsFrame.Create(TFMXObject(Sender));
        FrameItem.Parent := TFMXObject(Sender);
        TOptionsFrame(FrameItem).QuestionText.Text := BindSourceDBForm.DataSet.FieldByName('title').AsString;
        JSONArray := TJSONObject.ParseJSONValue(BindSourceDBForm.DataSet.FieldByName('options').AsString) as TJSONArray;
        TOptionsFrame(FrameItem).ValueComboBox.Items.BeginUpdate;
        for I := 0 to JSONArray.Count - 1 do
        begin
          TOptionsFrame(FrameItem).ValueComboBox.Items.Add(JSONArray.Items[I].Value);
        end;
        TOptionsFrame(FrameItem).ValueComboBox.Items.EndUpdate;
        JSONArray.Free;
      end;
      FrameItem.Name := 'F' + BindSourceDBForm.DataSet.FieldByName('ID').AsString;
      FrameItem.Align := TAlignLayout.Top;
      FrameItem.Tag := BindSourceDBForm.DataSet.FieldByName('ID').AsInteger;
      FrameItem.Position.Y := BindSourceDBForm.DataSet.FieldByName('ID').AsInteger * 100;
 
    BindSourceDBForm.DataSet.Next;
    Application.ProcessMessages;
  end;
 
  FrameItem := TCompleteFrame.Create(TFMXObject(Sender));
  FrameItem.Parent := TFMXObject(Sender);
  FrameItem.Name := 'FComplete';
  FrameItem.Align := TAlignLayout.Top;
  FrameItem.Position.Y := 1000000;
  TCompleteFrame(FrameItem).CompleteButton.OnClick := CompleteClick;
 
end;

The selected option in each TFrame gets sent back to the TFDMemTable via the UpdateValueByID() procedure as you can see below. In the below code the Self.Tag field corresponds to the ID field of the question.

//
procedure TOptionsFrame.ValueComboBoxChange(Sender: TObject);
begin
  MainForm.UpdateValueByID(Self.Tag,ValueComboBox.Items[ValueComboBox.ItemIndex]);
end;

The UpdateValueByID() procedure uses the Locate() procedure on the DataSet to find the correct record and then update the value field.
//
procedure TMainForm.UpdateValueByID(ID: Integer; const Value: string);
begin
  if BindSourceDBForm.DataSet.Locate('ID', VarArrayOf([ID]), []) = True then
  begin
    BindSourceDBForm.DataSet.Edit;
    BindSourceDBForm.DataSet.FieldByName('value').AsString := Value;
    BindSourceDBForm.DataSet.Post;
  end;
end;

Once the survey has been completed by the user then the entire contents of the TFDMemTable are saved out to the FireDAC JSON format and uploaded back to the server via a POST from a TBackendEndpoint component to the /survey/complete endpoint. In the case of the Hospitality Survey App all of the uploaded records are saved for each collected survey. This allows the survey questions to be created, removed, and changed without affecting any of the existing surveys that have already been collected.

Cross Platform Business Stats Dashboard App For Delphi 10.2.1 Tokyo On Android And IOS

$
0
0

The Hospitality Survey Client project is part of the Hospitality Survey App template for Delphi 10.2.1 Tokyo that Embarcadero has released through their GetIt platform. The Hospitality Survey App consists of four different projects plus a Survey Question Editor. And now there is a sixth project I am releasing for the Hospitality Survey App which is a Hospitality Survey Admin Client built in Delphi 10.2 Tokyo. The original business stats dashboard included with the Hospitality Survey App is built in AngularJS but I wanted to also build this same dashboard in Delphi.

I based the Hospitality Survey Admin Client off of the Hospitality Survey Client source code and just modified it a bit. The original client only downloaded the survey questions and then uploaded the results. I modified the client so that it downloads the admin business stats, a CSV file of the email addresses for the users who filled out the survey, the list of completed surveys, and the details of each individual survey. I only needed to add 4 new REST API calls to do this.  The code to dynamically generate the client survey form was modified to display the survey results dynamically. The relevant new API calls in the Admin Client are listed below:

GET /survey/results/* – Download the survey results in a paged fashion in FireDAC JSON format. The page number is placed where the * is.

GET /survey/stats/all – Download various stats about the survey results in FireDAC JSON format.

GET /survey/details/* – Download the questions and answers from a specific survey ID in FireDAC JSON format. The survey ID is placed where the * is.

GET /survey/emails/csv – Download a list of all of the email addresses from completed surveys in CSV format.

The JSON that is returned is already in FireDAC JSON format (from RAD Server) so it can be easily loaded into a TFDMemTable. The stats dashboard itself uses various FireMonkey objects to display some of the stats and it also uses TeeChart Lite which comes with Delphi 10.2 Tokyo to display the 3 charts. I tried to achieve the same look in feel of the dashboard in the Admin Client as the original AngularJS admin client. Here is the code below to load up the stats into the business dashboard. As you can see TeeChart Lite is pretty easy to use and the charts work across Android, IOS, OSX, and Windows with a single codebase and single UI. What is not visible in the code for TeeChart Lite is that the first Series chart has to be created by right clicking the chart component and selecting Edit Chart… and then choosing the Add… button to create the first chart Series. Once you create the first chart and select the chart type you can then start adding data to the chart via code.

 

procedure TMainForm.LoadStats(Sender: TObject);
var
  FrameItem: TFrame;
  FieldType: String;
  FieldCategory: Integer;
  JSONArray: TJSONArray;
  I: Integer;
begin
  ExpValueText.Text := getavg_exp_rating().ToString;
  FoodValueText.Text := getavg_food_rating().ToString;
  ServiceValueText.Text := getavg_service_rating().ToString;
  AmbValueText.Text := getavg_ambiance_rating().ToString;

  BarChart.Series[0].Clear;
  BarChart.Series[0].Add(getAmbiancePercentage(),'Ambiance ('+getAmbiancePercentage().ToString+')');
  BarChart.Series[0].Add(getServicePercentage(),'Service ('+getServicePercentage().ToString+')');
  BarChart.Series[0].Add(getFoodPercentage(),'Food ('+getFoodPercentage().ToString+')');
  BarChart.Series[0].Add(getExperiencePercentage(),'Experience ('+getExperiencePercentage().ToString+')');

  FirstTimeChart.Series[0].Clear;
  FirstTimeChart.Series[0].Add(getfirsttime_yes(),'First Visit ('+getfirsttime_yes().ToString+')');
  FirstTimeChart.Series[0].Add(getfirsttime_no(),'Multiple Visits ('+getfirsttime_no().ToString+')');
  FirstTimeChart.Series[0].Add(getFirstTimeNoAnswer(),'No Answer ('+getFirstTimeNoAnswer().ToString+')');

  RecommendChart.Series[0].Clear;
  RecommendChart.Series[0].Add(getrecommendus_yes(),'Would' + #13#10 + 'Recommend Us ('+getrecommendus_yes().ToString+')');
  RecommendChart.Series[0].Add(getrecommendus_no(),'Would Not' + #13#10 + 'Recommend Us ('+getrecommendus_no().ToString+')');
  RecommendChart.Series[0].Add(getRecommendNoAnswer(),'No Answer ('+getRecommendNoAnswer().ToString+')');
end;

Delphi 10.2 Tokyo has a build in project statistics package which shows you where you are using your time in the IDE when you are developing a project. Below is a screenshot of the time it could to modify the Hospitality Survey Client and turn it into the Hospitality Survey Admin Client. There was some extra debugging time needed to work out some display issues with TeeChart Lite on Android but other than that it was a pretty fast build.

Here is a screenshot of the original AngularJS Hospitality Survey Admin dashboard. It is styled with Bootstrap and uses a Javascript chart library.

Finally, here is a screenshot (see below) of the Delphi 10.2 Tokyo Hospitality Survey Admin Client which uses FireMonkey styling and TeeChart Lite for the business stats dashboard.

Download the full cross platform source code of the Hospitality Survey Admin Client for Delphi 10.2 Tokyo.

Keep Controls Visible When Virtual Keyboard Pops Up In Delphi 10.2 Tokyo On Android And IOS

$
0
0

One thing that can really add polish to your application is setting it up so that when an edit field receives focus it automatically appears above the keyboard on mobile devices. If this is not done the keyboard can sometimes cover the edit field so you are unable to see what you are typing. There are a number of different ways to do this in Delphi 10.2 Tokyo (and previous versions).  We’ve written about this before can you can check out those posts here and here. There is also an example from Embarcadero called FMX.ScrollableForm on how to do this. The ScrollableForm example works well and I have used it in the past. However, in Delphi 10.2 Tokyo and Delphi 10.2.1 Tokyo it does not work quite right on Android. Developer Dave Nottage has come up with a solution to this problem and provided some source code to fix it. First you need his free library from GitHub called Kastri Free. Next he posted some code to use with the library to make it all happen. Here is the code snippet:

//
//
// Include System.Messaging in the uses clause
 
type
  TForm1 = class(TForm)
  private
    procedure VirtualKeyboardRectChangeMessageHandler(const Sender: TObject; const M: TMessage);
  public
    constructor Create(AOwner: TComponent); override;
    destructor Destroy; override;
  end;
 
...
 
uses
  DW.Messaging, DW.VirtualKeyboard.Helpers;
 
constructor TForm1.Create(AOwner: TComponent);
begin
  inherited;
  TMessageManager.DefaultManager.SubscribeToMessage(TVirtualKeyboardRectChangeMessage,
VirtualKeyboardRectChangeMessageHandler);
end;
 
destructor TForm1.Destroy;
begin
  TMessageManager.DefaultManager.Unsubscribe(TVirtualKeyboardRectChangeMessage,
VirtualKeyboardRectChangeMessageHandler);
  inherited;
end;
 
procedure TForm1.VirtualKeyboardRectChangeMessageHandler(const Sender: TObject; const M: TMessage);
var
  LRect: TRect;
begin
  LRect := TVirtualKeyboardRectChangeMessage(M).Value;
  // LRect now contains the actual rect of the VK
end;

The full source code is available in a forum thread on the Embarcadero Forums site. You can head over there and see the full thread. The source code is mainly for Android but probably also works on IOS. I would assume it is not meant for Windows, OSX, or Linux. The Kastri Free library also has a lot of other functionality you can check out as well.

Check out the full forum thread about keeping the focused edit box visible on Android in Delphi 10.2 Tokyo.

Massive Set Of Free FireMonkey Components On GitHub For Delphi 10.2 Tokyo On Android And IOS

$
0
0

Developer zhaoyipeng has released a massive set of free custom FireMonkey components for Delphi 10.2 Tokyo over on GitHub. It would appear that most of this components support one or more of the FireMonkey platforms which are Android, IOS, OSX, and Windows (plus Linux unofficially through FMXLinux). The components look like they are available for free with source code from Github. Additionally, there are a number of demos plus screenshots showing the usage of the components. The current components are:

TFMXQRCode is a wrapper around the ZXing QRCode port to Delphi for generating QRCode images.

TFMXToast is a control that allows you to pop Android Toast style messages in FireMonkey apps.

TFMXSeg7Shape is a component for what appears to be displaying displaying LED style numbers.

There is a BaiduMap SDK wrapper for Firemonkey which looks useful for using the BaiduMap SDK in your Delphi apps.

TFMXCalendarControl is a custom calendar component in the IOS style for choosing dates on a calendar.

TFMXGuesturePassword is a keypad style control that takes gestures to generate a pin number like an unlock code.

TFMXSimpleBBCodeText is a simple control which looks like it formst BBCode text (which includes text colors) for display.

TFMXImageSlider is an easy to use image slider which can hold a group of images and allow you to slide between them.

TFMXCircleScoreIndicator is a circular progress indicator component that contains a number label in the center.

TFMXRatingBar is a custom control that allows you to set a star rating (as in a 5 star display).

TFMXScrollableList is a scrollable list component that looks similar to have the IOS date time or calendar picker works.

TFMXLoadingIndicator looks like a fantastic loading indicator library with a variety of loading animations.

graphics32 is a FireMonkey (and I assume cross platform) version of the popular graphics32 library for Delphi.

TFMXCallout is an upgraded version of TCallout that uses the INativeCanvas to draw with smooth lines.

INativeCanvas is a custom helper class for TCanvas which gives you smooth lines across platforms.

TFMXRotatingText is a rotating text component similar to a the rolls on a slot machine.

Head over to Github and download the full source code for this awesome free FireMonkey component set for Delphi 10.2 Tokyo.

Right To Left BiDi Library FMXRTL For Delphi 10.2 FireMonkey On Android And IOS

$
0
0

If you are looking to build cross platform apps in FireMonkey for languages that read right to left (also known as bi-directional or BiDi support) there are a number of different solutions. One of those solutions is the FMXRTL library which I assume stands for FireMonkey Right To Left (verses RunTime Library). FMXRTL has a version for Delphi 10.2 Tokyo and Delphi 10.1 Berlin. Apparently part of how it works is there is a TFMXRTL component which changes some core objects in FireMonkey that handle text presentation. These changes cause BiDi support to trickle down to all of your existing FireMonkey controls. It doesn’t mention which platforms are explicitly supported by FMXRTL but I would assume Android, IOS, OSX, and Windows are probably supported. At the moment it appears that the FMXRTL package is free but also appears to be in beta or at least experimental. You may have to just download it and check it out for yourself to see if it can solve your BiDi needs. Some other BiDi solutions include using the Delphi HTML Component Library as your presentation layer or using TurboCocoa for your presentation layer (which allows you to use Xcode and Android Studio to build your interface).

Head over and find out more info about FMXRTL and then download the Delphi 10.2 Tokyo version.

Enterprise Healthcare App Prototype Built With FireMonkey Dominates Startup Weekend Competition

$
0
0

A Startup Weekend competition was held in Southern California where teams competed to build a startup in 54 hours. I participated on one of the teams and built this app prototype using Delphi FireMonkey. Our team won first place in the competition. We had about 21 actual hours to work on the project (read more about it here). Some other teams were using XCode and the time savings that Delphi provided was real. Time was limited so I built all of the screens (20+) in a graphics program and then exported them to PNG files. I based the look and feel of the app on the Emerald Crystal FireMonkey premium style because I knew I would be able to quickly transition from a prototype to a real app using the style. The app runs on Android, IOS, OSX, and Windows with a single codebase and single UI. For the competition we only deployed the app to Android and Windows. I used a TTabControl with one screen in a TImage on each TTabItem. It is a prototype so I just used a TRectangle that is set to transparent above each button to catch the clicks and navigate through the screens. Here is the code from each transparent button:

//
//
procedure TForm1.Rectangle10Click(Sender: TObject);
begin
TB.SetActiveTabWithTransition(AllergiesTab,TTabTransition.Slide);
end;

What was interesting about the build is that I thought it would work across screen sizes but I should have used a TScaledLayout to handle the changing button sizes. Instead I found that my buttons didn’t line up with the image buttons between a Phone and a Tablet screen size (so I ended up making 1 app for each size because of the time limit). If I had used TScaledLayout I think it would have handled the two screen sizes correctly. The other functionality I built into the prototype was making a phone call within the app. One of the screens allows a medical professional to contact a patient and that code was simple in Delphi so I included it. Here is that code (requires FMX.Platform and FMX.PhoneDialer in the uses clause):

//
//
procedure TForm1.Rectangle40Click(Sender: TObject);
var
PhoneDialerService: IFMXPhoneDialerService;
begin
{ test whether the PhoneDialer services are supported }
  if TPlatformServices.Current.SupportsPlatformService(IFMXPhoneDialerService, IInterface(PhoneDialerService)) then
  begin
  { if the Telephone Number is entered in the edit box then make the call, else
  display an error message }
    PhoneDialerService.Call('1234567890');
  end;
end;

Some other functionality which the solution needs but I wasn’t able to include due to the time limit was QR code scanning. QR code scanning is really simple in Delphi as there are a number of third party components available to drop in and go. One such library for that is the OBR library from Winsoft. Another functionality of the enterprise solution in the project was a QR code printer and there is also a third party solution from Winsoft for that as well.

Check out the full source code for the prototype built in Delphi FireMonkey for Windows and Android.

A full run down of the capabilities behind the enterprise prototype is available in the video below.

 


Important List Of Fixes Released In Update For Delphi 10.2.2 Firemonkey On Android And IOS

$
0
0

Embarcadero has released an Update for Delphi 10.2.2 Firemonkey with quite a few bug fixes for Firemonkey, the REST client, JSON, mobile keyboard bounds checking, and deploying to Android and IOS devices. In addition to the Firemonkey fixes there are additional fixes across the product line including fixes in the compilers, FireDAC, BaaS, and the IDE. If you are on the Update Subscription you can download it now. If you are not on the Update Subscription you should be. According to the release notes there are also: “Several key new features were added, including FireMonkey Quick Edit support, a number of new VCL controls, a new dark themed IDE option, a RAD Server single site deployment license in Enterprise and Architect editions, installer and welcome page enhancements and more.” Macro Cantu has a blog post up about the Update with more information. Here are the important fixes that jump out:

  • [NET] TNetHTTPClient.Head + HandleRedirects = Recives not the Full Header
  • [NET] TURI SetParameter doesn’t update the Query
  • [REST] Rest component seems not disconnecting
  • [NET] TNetHTTPClient/TRESTRequest: TLS 1.1 and 1.2 unsupported
  • [NET] THttpClient with TLS1.1 and TLS1.2 on older Windows systems
  • [NET] HttpClient not process 304 correctly
  • [JSON] TJSONObject.ToString() crashes after 1057 chars (unicode)
  • [REST] TRESTRequest – Root element cannot start with a dot (Dropbox)
  • [REST] TRESTClient handle/memory leak
  • [REST] REST Redirect 302 behaviour changed Berlin
  • [NET] THTTPClient POST redriects(301,302,303) has to be sent as GET
  • [JSON] TJSONMarshal / TJSONUnMarshal causes conversion error w/ TDateTime field
  • [JSON] TJson.Format() outputs invalid JSON
  • [NET] HTTPClient handling 304 as redirection
  • [REST] URIEncode function from REST.Utils doesn’t work properly
  • [JSON] TJSON.ObjectToJsonObject raise an exception when object is nil
  • [REST] TRESTRequest AfterExecute called twice if ExecuteAsyncused
  • [FMX] Application with several tab & listview freeze when back from background On android
  • [IOS] XCode9 and 64Bit not working (iOS)
  • [FMX] Menus close prematurely on MacOS High Sierra
  • [FMX] Applications recompiled with 10.2.1 showing lots of memory leaks!!!
  • [FMX] TBitmap.LoadFromFile locks files exclusivly
  • [FMX] clone() on second level herited component doesn’t work
  • [FMX][Android][C++Builder]Drawing Noise is generated when selecting DropDownItem Of TComboBox(TComboBox::DropDownKind=Custom)
  • [FMX] Program hanging by other Style
  • [FMX] Multiview Popover does not work anymore
  • [ANDROID] Android application crash at startup
  • [FMX] Incorrect logic in TTabControl.FindVisibleTab can cause a crash
  • [FMX] ScrollableFormDemo doesn’t work
  • [ANDROID] Android Application->OnIdle Failed
  • [FMX] A missing condition in unit FMX.WebBrowser in our app causes extremely memory usage and crash on mobile devices (both iOS and Android)
  • [FMX] FormVirtualKeyboardShown gives wrong bounds
  • [ANDROID] SubscribeToMessage in Android will crash
  • [FMX] Exception on Gesture
  • [IOS] iPhone 7 users can’t double tap
  • [FMX] missing raise keyword in FMX.Context.Mac
  • [FMX] RaiseContextExceptionFmt do not raise anythinh
  • [FMX] [WIN]WebBrowser and StyleBook and MainMenu made app crash
  • [FMX] AV when unloading DLL, containing FMX dialogs
  • [IOS] iOS AdHoc not working with Tokyo 10.2.1
  • [FIREDAC] FireDAC Can not connect to MS Sql Server 2000

Head over and check out the full list of bug fixes in the Delphi 10.2.2 update over on the Embarcadero EDN site.

Quickly Integrate With A Bitcoin Cryptocurrency Exchange API With Delphi 10.2.2 For Android And IOS

$
0
0

Integrating with Bitcoin Cryptocurrency exchange APIs can sound like a daunting task but it was relatively easy to do with Delphi and FireMonkey. Unless you have been living under a rock you probably know that Bitcoin and other cryptocurrency have really seen a surge in value throughout 2017. If you HAVE been living under a rock you can check out this newbies guide to bitcoin and cryptocurrency. GDAX is an exchange owned by the popular Coinbase company. I literally built a REST client that talks to the GDAX API in 5 minutes and was able to start downloading the list of currencies on the exchange and getting price quotes for a currency. This is the first step to building an automated trading client, bot, or AI for cryptocurrencies. In addition to that because I used FireMonkey that same app client will deploy to Android, IOS, Mac, and Windows with a single code base and single UI.

You can check out the documentation for GDAX for yourself to see the rest of the REST API end points. I grabbed the products endpoint and the products book endpoint and used those two endpoints in the REST Debugger to quickly and easily download the data and LiveBind it to controls in my Delphi client. The first /products/ API I used directly because it doesn’t have any parameters. Once you select one of the cryptocurrency pairs at runtime it will use that for the next request to the /products/{currency}/book endpoint. The variable there can be set using code like the below and then it will automatically be filled in when the RESTRequest is executed (it is of type pkURLSEGMENT). The “/products/{currency}/book” string goes in the Resource property of the TRESTRequest component. I ended up only writing three lines of code for the whole app.

//
//
procedure TForm1.Button1Click(Sender: TObject);
begin
RESTRequest1.Execute;
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
RESTRequest2.Params.ParameterByName('currency').Value := Edit1.Text;
RESTRequest2.Execute;
end;

I also applied the Jet premium style (which gives the dark look to the client). As you can see in the screenshot I am also running the new dark theme in Delphi 10.2.2. It is really easy to get started using Delphi as a platform for creating your own bitcoin cryptocurrency AI bot GUI apps. You could also use Python on the back and just have Delphi execute your various Python commands if you already have a command line based Python cryptocurrency trading bot.

Download the full source code for the GDAX Quotes Bitcoin cryptocurrency REST API client app source code for Delphi 10.2.2 on Android and IOS.

 

Easily Build A Bitcoin Cryptocurrency Profit And Loss Tracker In Delphi 10.2 Tokyo For Android And IOS

$
0
0

Keeping track of your cryptocurrency across multiple exchanges can be a chore. I built this simple cryptocurrency profit and loss tracker for your bitcoin and altcoin holdings. Basically the tracker ties into the CoinMarketCap.com REST API for getting currency quotes and allows you to store your current holdings in an FDMemTable. Once you add all of the cryptocurrencies that you hold into the TStringGrid you can add the price that you paid for them and the amount that you have. The app does the needed calculations automatically using the quote data that it pulls down from CoinMarketCap when you press the Refresh button in the app.

I built the app interface mainly for Windows but it should also work well on OSX plus Android and IOS tablet devices. It does use a TMultiView to hold the list of 1300+ cryptocurrencies (double click to add) but some of the controls could be re-arranged for a better layout on phone size devices (by using a TTabControl). There are two TFDMemTables within the app. The first one is tied to the TRESTClient controls which I created using the REST Debugger. The REST Debugger basically has a cheat button which will create all of the needed controls to access a REST API and pull the data into a TFDMemTable with no code. In any event the TFDMemTable tied to the REST client holds the quote data that you request from the CoinMarketCap API. The other TFDMemTable holds the list of your cryptocurrency holdings. Both TFDMemTables are LiveBinded to their own TStringGrids. When you select one of your cryptocurrency holding records in the second TFDMemTable you can also edit the data in the edit fields on the right side of the app. They also use LiveBindings for updating the data in the holdings TFDMemTable. I also used the Vapor premium style to get the look and feel of the app.

I have published the full source code for the app over on GitHub. According to the Delphi IDE stats it took around 21 minutes to build this app. Be sure to check out the other blog post about integrating Delphi with the GDAX cryptocurrency trading API as well.

 

Head over and download the full source code for the Crypto Coin Profit Tracker for Delphi on GitHub.

Build Cross Platform Mobile Apps For Free In 2018 With Delphi Community Edition

$
0
0

Embarcadero Technologies has released a Community Edition of Delphi and C++Builder featuring the cross platform FireMonkey framework for Android, IOS, OSX, and Windows. FireMonkey can be used to develop cross platform apps with a single codebase and single UI in Object Pascal and C++. Cross platform apps save you time and money by allowing to you deploy development resources more efficiently. FireMonkey also leverages time saving low code technologies like FireDAC and LiveBindings. Users or companies with less than $5k in annual revenue and between 1 and 5 developers can use the Community Edition to developer apps for FREE. Once you reach the limit of $5k/year and 5+ developers the upgrade path is to the Professional edition of the product. The Community Edition has the exact same feature set as the Professional edition except for the license. There are also free trial versions of the Pro, Enterprise, and Architect version of the product available. There are over 600 tips and tricks for FireMonkey on FMXExpress.com to get you up to speed quickly on FireMonkey and get your cross platforms apps deployed to Android, IOS, OSX, and Windows FAST. Check out this quick tutorial for building your first app in Delphi Communty Edition:

Part 1: Introduction and Installation

Part 2: Building and Debugging in Delphi

Part 3: Architecture and Layers

Part 4: Designing User Interfaces

Part 5: Putting the Calculator Together

Also get the full source code for a comprehensive cross platform Field Service Template solution and a Hospitality Survey Template built in FireMonkey for Android, IOS, OSX, and Windows.

Head over and check out out of full announcement of the Delphi Community Edition!

Blazing Fast OpenGL Based Video Playback For Android And IOS In Delphi 10.2 FireMonkey

$
0
0

The Alcinoe Component Library For Delphi provides an OpenGL texture based video play for both Android and IOS. If you are looking to have video playback in your Delphi FireMonkey apps on mobile devices this is a good solution to take a look at. On Android devices it utilizes the ExoPlayer and on IOS devices it utilizes the AVPlayer. “ExoPlayer is an open source project that is not part of the Android framework and is distributed separately from the Android SDK.” The audio side of ExoPlayer uses the Android MediaCodec API and so it requires at least Android 4.1. The video itself gets drawn to an OpenGL texture inside which means that the z-order is correct allowing you to place FireMonkey controls on top of your rendered video. Additionally, it looks like you can apply FireMonkey render effects like magnify and pencil to the rendering video which is a nice touch. The Alcinoe library is free over on GitHub with full source code. The library is quire extensive with other functionality as well. The library only provides a FireMonkey solution for Android and IOS devices and source code is available if you need to extend it to Windows, Linux, or OSX devices.

Head over and download the full source code for the Alcinoe library with OpenGL video playback for Delphi 10 FireMonkey.

Mega FireMonkey Style Pack And UI Enhancements For Delphi 10.2 Tokyo On Android, IOS, macOS, Windows

$
0
0

The team over at KSDev (who also publish FMXLinux) have a massive set of custom styles for FireMonkey available over on their DelphiStyles.com site. There are over 39 different styles fore FireMonkey. Some of the styles are for all of FireMonkey’s platforms which include Android, IOS, macOS, Windows, and Linux while other styles look like they are for specific platforms (Windows, macOS, and Linux). In addition to all of the styles they have available they also have a FireMonkey UI Plus pack. The FM UI Plus pack contains a significant number of enhancements for FireMonkey which make your app more polished on Windows or macOS. Here is the current full list of enhancements:

  • New default HQ style for macOS from delphistyles.com, which includes graphics with all specifics of “Sierra” and “High Sierra” at this moment
  • New focused frame around controls on macOS, which looks as native
  • New toolbar style, which can be merged with window caption to get more native look and feel on macOS
  • Fixes of text drawing on macOS and Windows systems
  • Fixes of TCalendar, TGrid drawing on Windows and macOS
  • More all possible fixes and improvements for different platforms in the future
  • Quickly implementation of UI changes for different platforms in the future
  • Easy to Enable / Disable “FM UI Plus” for your application (just call project popup menu and select one item)

Utilizing custom styles and or deploying these FireMonkey enhancements can really polish the look and feel of your apps to deliver a profession product to your customers. The DelphiStyles are a commercial product which have a lifetime subscription (which I assume means you receive free updates for life). You can also bundle it for cheaper with FMXLinux and some of their other offerings. C++Builder utilizes FireMonkey styles as well so they are also usable in your C++ apps.

Head over and check out all of the professional looking unique styles for Delphi 10.2 FireMonkey on Android, IOS, macOS, and Windows.

Learn How To Open A Delphi FireMonkey App With A Custom URL Scheme On IOS

$
0
0

It is surprisingly easy to launch your FireMonkey app on IOS from another app and pass it some basic settings. I have tested this solution on a recent IPad and IOS 11.4. This functionality is provided by Apple and you can easily modify your Delphi FireMonkey app to register it’s own URL Scheme and handle the incoming settings. The first thing you need to do is edit your info.plist.TemplateiOS.xml file in your project directory. Under the <%ExtraInfoPListKeys%> line you should add the following:

<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>myappurlschemename</string>
</array>
</dict>

Be sure to replace the myappurlschemename with the actual name of your app or at least the name of the scheme you want to register and use to launch your app. It gets used to launch the app in a URL like this: myappurlschemename://mypage?myname=myvalue You can paste myappurlschemename://mypage?myname=myvalue into Safari to test launching your app. There is also a good tutorial here for XCode so you can see how it works from the XCode side.

Next up you need to add some code to your app to handle the TApplicationEvent.OpenURL event. You can do this with the following code. You will want to add FMX.Platform to your uses section and you will want to start listening to the FMXApplicationEventService in your TMainForm.OnCreate event:

uses
FMX.Platform,
{$IFDEF IOS}
FMX.Platform.iOS
{$ENDIF}

procedure TMainForm.FormCreate(Sender: TObject);
var
  FMXApplicationEventService: IFMXApplicationEventService;
begin
  if TPlatformServices.Current.SupportsPlatformService
    (IFMXApplicationEventService, IInterface(FMXApplicationEventService)) then
    FMXApplicationEventService.SetApplicationEventHandler(HandleAppEvent);
end;

function TMainForm.HandleAppEvent(AAppEvent: TApplicationEvent;
  AContext: TObject): Boolean;
begin
  case AAppEvent of
     TApplicationEvent.OpenURL:
     begin
  {$IFDEF IOS}
       LaunchURL := TiOSOpenApplicationContext(AContext).URL;
  {$ENDIF}
     end;
  end;
  Result := True;
end;

When the event executes and your app is launched the LaunchURL string will get filled with the URL that the app was launched using. You can then parse the LaunchURL string to get the various parameters out of it. You’ll need IdURI and IdGlobal in your uses section for the below code. Here is the sample code to parse the URL:

var
Params: TStringList;
MyValue: String;
begin
  if LaunchURL<>'' then
    begin
      Params := TStringList.Create;
      try
        URI := TIdURI.Create(LaunchURL);
        try
          Params.Delimiter := '&';
          Params.StrictDelimiter := true;
          // Path = URI.Path
          Params.DelimitedText := URI.Params;
        finally
          URI.Free;
        end;

        for I := 0 to Params.Count -1 do
          begin
            Params.ValueFromIndex[I] := StringReplace(Params.ValueFromIndex[I], '+', ' ', [rfReplaceAll]);
            Params.ValueFromIndex[I] := TIdURI.URLDecode(Params.ValueFromIndex[I], IndyTextEncoding_UTF8());
          end;

	MyValue := Params.Values['myname'];
      finally
        Params.Free;
      end;
      LaunchURL := '';
    end;
end;

Check out the Delphi 10.2 Tokyo documentation for TApplicationEvent.OpenURL which shows you the other properties of TiOSOpenApplicationContext.

 


Cross Platform ZX Spectrum Emulator Built In Delphi FireMonkey for Android, IOS, OSX, And Windows

$
0
0

Developer TetrisSQC over on Github has released a ZX Spectrum Emulator built with Delphi Firemonkey. Apparently it works on Android, IOS, OSX, and Windows using a single codebase and single UI. The ZX Spectrum was an 8-bit computer that came out in 1982. There are also different variations in the hardware which were released later and the emulator supports some of those as well (48k, 128k, 2A/3A, Pentagon, and Scorpion). Reviewing the source code it looks like it uses the cross platform SDL library for handling sound. If you want to see how to utilize a cross platform library like this from Firemonkey on Android, IOS, OSX, and Windows this is a great example. Lots of good code here for scanline style drawing too. There is also all kinds of other great code Check out the conditional compilation for loading the library on each platform:

{$IFDEF MACOS}
{$IFDEF CPUARM}
  libsdl = 'libSDL2.a';
{$ELSE}
{$IFDEF IOS}
  libsdl = 'libSDL2.dylib';
{$ELSE}
  libsdl = 'libSDL.dylib';
{$ENDIF}
{$ENDIF}
{$ENDIF}
{$IFDEF MSWINDOWS}
  libsdl = 'SDL.dll';
{$ENDIF}
{$IFDEF ANDROID}
  libsdl = 'libSDL2.so';
{$ENDIF}

In any event full source code for the emulator is available over on Github. There are all kinds of games and various other apps that are available for the ZX Spectrum.

Head over and get the full source code for the ZX Spectrum emulator built in Delphi Firemonkey on Github.

Auto Generate REST API Clients In FireMonkey With Delphi 10.2 Tokyo For Android And IOS

$
0
0

Auto Tables for RAD Server is a powerful automation solution that allows you to automatically generate a REST API in Delphi 10.2 Tokyo. It will take a look at your existing database tables and automatically create the CRUD code for adding, editing, and deleting records from the existing database via a REST API. You can literally deploy a REST client and server solution for an existing FireDAC supported database in a few clicks. The REST API is deployed as a RAD Server. Auto Tables for RAD Server is similar to other solutions like DreamFactory, Sandman, and LoopBack. Once the server is generated it also generates a FireMonkey client for accessing the REST API. The Delphi FireMonkey client should run on Android, IOS, Windows, OSX, and Linux (with FMXLinux). There are actually three separate ways generated to access the REST API that you create. The first is a Delphi project with a DataModule suitable for building a FireMonkey client and leveraging LiveBindings to quickly build out the UI of your client. The second way is through a code only Object Pascal SDK that is generated for your REST API. Lastly, an OpenAPI spec file is generated that defines the endpoints in your API. You can use the OpenAPI spec file to generate all kinds of other clients for the REST API using either SwaggerHub or OpenAPI CodeGen. The Auto Tables for RAD Server project is free and open source using an MIT license. The project has extensive documentation and the REST API is packed with features like paging, custom queries, and aggregate queries for building dashboards. Additionally, it supports setting up enterprise grade permissions through RAD Server. You can probably also use the generated SDK in your C++Builder clients. At the time of this writing a RAD Server license is included with Delphi Enterprise Edition and up.

Head over and download the full source code for AutoTablesForRADServer and generate your REST API in seconds.

Auto Tables Logger REST Client And RAD Server Sample For Delphi 10.2 Tokyo On Android And IOS

$
0
0

Auto Tables for RAD Server is a client server solution which auto generates a REST API client/server/OpenAPI for your databases. The sample application and database that comes Auto Tables for RAD Server is called Logger and uses InterBase. You can swap out InterBase for any other database supported by FireDAC. I went ahead and generated the Logger sample project in the Auto Tables Editor and it is provided with this post. The client project should run on Android, IOS, OSX, Windows, and Linux (through FMXLinux). The server should run on Windows and Linux but has only been tested on Windows. I hooked up the LiveBindings in the client to some TStringGrids and some buttons to execute the REST API calls. There are three REST endpoints which are correspond to GET POST and DELETE. GetLogger for requesting the list of records from the Logger database table. PostLogger for posting a new record into the Logger database table. And finally DeleteLogger for deleting a recording out of the Logger database table. All of the REST API are made to the included RAD Server project. As you will see in the RAD Server project the endpoints are contained within a TFDMemTable. The Auto Tables Editor also generates a FireDAC JSON file which can be loaded into the TFDMemTable inside the sample RAD Server project. This allows you to make changes to the REST API endpoints without having to entirely re-generate the server project. As you will see in the sample the documentation for the REST API is provided via Swagger-UI in the Docs directory of the sample. Here is the entire source code that I added to the sample project after the auto generation of the client and server were complete.

//
//
//
procedure TMainForm.GetStringGridSelChanged(Sender: TObject);
begin
  DeleteIdEdit.Text := GetStringGrid.Cells[0,GetStringGrid.Selected];
end;

procedure TMainForm.GetBTNClick(Sender: TObject);
begin
  AutoTablesClientDM.getloggerExecute;
end;

procedure TMainForm.PostBTNClick(Sender: TObject);
begin
  AutoTablesClientDM.postloggerExecute;
  GetBTNClick(Self);
end;

procedure TMainForm.DeleteBTNClick(Sender: TObject);
begin
  if DeleteIdEdit.Text<>'' then
   begin
     AutoTablesClientDM.deleteloggerExecute(DeleteIdEdit.Text);
     DeleteMemo.Lines.Append('Delete ' + DeleteIdEdit.Text + ' sent successfully!');
     DeleteIdEdit.Text := '';
     GetBTNClick(Self);
   end;
end;

Download the full source for the Auto Tables For RAD Server Sample Logger solution.

Browse and download the full source code for the Auto Tables For RAD Server Sample Logger solution on GitHub.

Anatomy Of A Delphi 10.3 Rio Firemonkey App On #Android, #IOS, #Windows, And #macOS

$
0
0

If you are new to working with a full featured framework like Firemonkey you may be wondering at the size of the apps that Delphi 10.3 Rio Firemonkey generates. The Firemonkey Framework has hundreds of thousands of lines of code that allows you to jump ahead and start building the app you want to build now instead of the bricks in the road to get there. Hopefully this infographic will provide some insight into what makes up an APK/IPA cross platform application deployed from Delphi 10.3 with the FMX framework. The infographic covers Android, IOS, Windows, and Mac OSX apps/packages/libraries/archives created using the Firemonkey framework. Tools that utilize the Firemonkey framework are Delphi 10.3, C++Builder 10.3, and RAD Studio 10.3. The infographic only covers Release mode (something you could deploy to your customers). I have also included a VCL section in the infographic so that you can compare the Windows only VCL framework to the cross platform FMX framework. Also keep in mind that when you use debug information or are in Debug mode your file could be significantly larger. The sizes of the generated files are included in the green circles. There is the normal compiled size and then there is the compressed or packaged size. APK and IPA files are packaged and compressed. The compressed sizes for Windows and Mac OSX were achieved using the 7Zip format. Here is some information directly from the infographic as well about what units are included in a FMX app on Android (it is slightly different on each platform) and how those units effect the size of the deployable file.

Let’s start off with a Hello World app which is basically a FMX form with a TLabel on the form. This comes out to around ~5.88MB when deployed to Android as an APK. Even though this is a Hello World app there is already much more functionality here than just the ability to print out ‘Hello World’ to the screen. A true ‘Hello World’ would be much smaller because it would lack these Firemonkey framework units. The FMX and RTL units included are:

System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants, FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, FMX.Controls.Presentation, FMX.StdCtrls

Next up I’ve listed what I call a Basic App that clocks in at ~6.45MB. A basic app has some more visual controls available to it like a TListView, a TEdit, a TListBox, a TTabControl, a TMemo, and even some access to advertising. Here are the FMX units included (in addition to the units from the Hello World app):

FMX.ListView.Types, FMX.Memo, FMX.ListView.Appearances, FMX.ListView.Adapters.Base, FMX.Advertising, FMX.TabControl, FMX.ListBox, FMX.Layouts, FMX.Edit, FMX.ListView, FMX.ScrollBox

This next tier of app size I’ve termed Services because it is basically some Android JAR files which when fully included bring the app up to around ~6.61MB. These services are basically helper services for Android (some of which are provided by Google) like Google IAP, GCM, and Analytics. You can include and exclude each of these files from your APK separately. Here is a list of the additional files:

android-support-v4.dex.jar, cloud-messaging.dex.jar, fmx.dex.jar, google-analytics-v2.dex.jar, google-play-billing.dex.jar, google-play-licensing.dex.jar, google-play-services-*.dex.jar (there are a number of play services covered by this wildcard)

Next up we have what I have termed the Consumer App style app tier which rings in at around ~9.50MB. Obviously if you add more or differently functionality the size of your app can fluctuate greatly. You could also build games and they might fall in this size range depending on how many external graphics and sound you used. This type of app includes more functionality like the RESTClient, the in app purchases unit, sensors, a grid component, and the camera component. Here are the additional FMX and RTL units included by the IDE when these new components (in addition to all of the above) were added:

System.Sensors, System.Rtti, FMX.Grid, System.Sensors.Components, FMX.Media, REST.Response.Adapter, REST.Client, Data.Bind.Components, Data.Bind.ObjectScope, System.Actions, FMX.ActnList, FMX.InAppPurchase

Lastly we have the Enterprise and Database App tier which comes in at around ~11.1MB+ but can increase size from here the more you add to your app. This includes FireDAC functionality for accessing an SQLite database, LiveBindings to bind the data to a grid, accessing various path utility functions, and creating ini files for settings storage. At this level you can add tens of thousands of lines of code and lots of forms and the app could still be around this size. The RTL and FMX units included when this functionality was added (in addition to all of the above units) are as follows:

FireDAC.Stan.Intf, FireDAC.Stan.Option, FireDAC.Stan.Param, FireDAC.Stan.Error, FireDAC.DatS, FireDAC.Phys.Intf, FireDAC.DApt.Intf, Data.DB, FireDAC.Stan.ExprFuncs, FireDAC.Phys.SQLiteDef, System.Bindings.Outputs, Fmx.Bind.Editors, Data.Bind.EngExt, Fmx.Bind.DBEngExt, Data.Bind.Components, Data.Bind.DBScope, FireDAC.Phys,FireDAC.Phys.SQLite, FireDAC.Comp.Client, Fmx.Bind.Grid,FireDAC.Phys.SQLiteVDataSet, FireDAC.Comp.DataSet, System.IniFiles, System.IOUtils, FMX.Grid.Style, Data.Bind.Grid, REST.Types, Data.Bind.ObjectScope

You can also take a deep dive into the Firemonkey Framework itself using the Delphi Unit Dependency Scanner. The unit dependency scanner will show you all of the units that your app uses and all of the units that those units use in a treeview. It will also show line numbers of each unit and a total line number count of your entire project.

You can find out more about the Firemonkey Framework on the Embarcadero DocWiki and on the FiremonkeyX website.

Download the full Anatomy of a Firemonkey Framework Multi Platform App infographic for future reference.

Electronic Medical Record CRUD REST API Client And Server For Delphi 10.3 Rio On Android And IOS

$
0
0

OpenEMR is a “leading open-source electronic medical record and practice management software.” Auto Tables for RAD Server was used to generate a FireMonkey CRUD REST client and RAD Server REST API for the OpenEMR database schema. Auto Tables for RAD Server is an open source project that will take any FireDAC supported database and automatically generate a RAD Server REST API for the database. Additionally, Auto Tables for RAD Server will now automatically generate a CRUD REST client in Delphi FireMonkey to connect the RAD Server REST API. The automatically generated OpenEMR FireMonkey client should run on Android, IOS, macOS, Windows, and Linux (using FMXLinux). This is a single source client and a single UI. It uses a number of Delphi features like Tasks, the Embarcadero dark style (Material Oxford Blue), the EMS components, LiveBindings and much more. Both Auto Tables for RAD Server and the OpenEMR CRUD REST API sample are free and open source. You will need to edit the FDConnection component in the RAD Server project to enter your MySQL username, password, and hostname. Additionally, your database should be named openemr. Otherwise you will need to re-generate the project with Auto Tables for RAD Server using your specific database name. You can find out more about the OpenEMR project and download the source code over on GitHub. OpenEMR is built in PHP and uses MySQL as the database.

Head over and download the full source code for the OpenEMR CRUD REST API client and server for Delphi FireMonkey.

Viewing all 75 articles
Browse latest View live