From the bragging “Did you know the IDE starts almost twice as fast in 10.2.2 as it did in 10.1?”

An interesting discussion sprouted from the bragging [WayBack] Did you know the IDE starts almost twice as fast in 10.2.2 as it did in 10.1? https://community.embarcadero.com/blogs/entry/new-in-10-2-2-welcome-page-… – David Millington – Google+. I do not care very much about IDE start times (Visual Studio starts faster, others like Android Studio start slower than Delphi), more about productivity. Which means loading projects, opening files and forms, switching projects, etcetera need to be fast and stable. For me this is when on Delphi projects, I start about half a dozen copies of Delphi about 10 seconds apart (otherwise you get exceptions in any Galileo version), make some tea, then come back. Each time an IDE crashes, I kill it, start a new one, switch to an existing one, load the projects I need and continue. On a full day working with Delphi, this happens about a dozen times a day. After that I want to be productive. Here is where I was so surprised by the great tip from Yusuf Zorlu +Asbjørn Heid you should try to disable all “livebinding” packages + rename dclbindcomp250.bpl . If i opened a form before i had to wait 20 to 40 seconds … now it is superfast and opens forms under 5 seconds. I don’t need LiveBindings … and the response by Asbjørn Heid +Yusuf Zorlu Thank you! Holy cow that’s a difference! As you say, even our most complex forms are down to 4 seconds now. I never use LiveBindings as they are way to convoluted, unstable and result in logic being in designers as opposed to tool-manageable code. In addition, LiveBindings have never been really optimised since their inception in Delphi XE2. This saves a lot of time! So one day, I need to update Source: Delphi packages I have disabled by prefixing their description with an underscore (and why) and create a batch file with the various [WayBack] reg add commands modifying the package loads. Related: [WayBack] Berlin 10.1 Update 2 – more prone to hanging in the IDE? I just did a clean RAD Studio install on a clean Windows 10 install, but I don’t think I’ve ev… – Lars Fosdal – Google+ Delphi XE8 things I learned from the second week of G+ reading Jim Tierney published some great Delphi XE3 LiveBinding posts [WayBack] Delphi XE7 IDE is slow like XE2,XE3,XE4,XE5,XE6 [Edit] [WayBack] QualityCentral 102843: XE2 IDE hangs when opening large units [WayBack] QualityCentral 103520: VERY SLOW F12 SWITCHING betwen unit and form [WayBack] QualityCentral 116169: Slow opening forms in IDE XE3/XE4 [WayBack] QualityCentral 121139: IDE Slow to open and switch unit/form [Archive.is] XE2: LiveBinding Packages slow down the IDE | Andy’s Blog and Tools –jeroen
Read More

RAD Server 10.2.3 Performance Patch

Embarcadero has just released a performance patch for the RAD Studio 10.2.3 version of RAD Server, our REST-based web service hosting architecture.  Getting The RAD Server Optimization Patch This patch is available at http://cc.embarcadero.com/item/30838 and it includes a new set of binary files, for the different types of servers (both development and deployment). The patch includes a number of optimizations: better configuration of the memory manager for heavy multi-threading, optimized processing, optimized license checking, and much more. The patch includes also an additional feature, a KeepAlive option for the Dev server you can adding a setting to the EMS.INI configuration files (as described in the readme). Testing the Optimization Patch I've personally tested the patch against the development version of RAD Server in the following scenario: I run the server without debugging, disabled logging, and used Apache Benchmark client (ab) from a different machine on the same network. I used different calls, but eventually settled on these: ab -n 1000 -c 10 -k http://192.168.1.111:8080/xyz ab -n 1000 -c 10 -k http://192.168.1.111:8080/data The two endpoints were different. The first is a hello world type of call, returning the same string and the time in a JSON string, with a document length of 17 bytes: // Code for [ResourceName('xyz')] procedure TXyzResource.Get(const AContext: TEndpointContext; const ARequest: TEndpointRequest; const AResponse: TEndpointResponse); begin AResponse.Body.SetValue(TJSONString.Create('xyz ' + TimeToStr(Now)), True) end; The second endpoint executes a FireDAC query returning a database table in a stream, based on the internal FireDAC JSON format, and with a document length of 13,909 bytes. // Code for [ResourceName('data')] procedure TDataResource1.Get(const AContext: TEndpointContext; const ARequest: TEndpointRequest; const AResponse: TEndpointResponse); var AStream: TStream; begin EmployeeConnection.Connected := True; FDQuery1.Open; AStream := TMemoryStream.Create; FDQuery1.SaveToStream(AStream, sfJSON); AResponse.Body.SetStream(AStream, 'application/json', True); end; The components have a very simple configuration, with a connection to the sample InterBase database, and the query 'select * from employee'. The Data from the Test I've tested the same scenario, same machines, same code with 10.2.3 (before applying the patch) with the patch, and with some additional fine tuning in the configuration. The table below has the information from ab for the 2 endpoints:   data xyz 10.2.3 plain Requests per second: 49.70 Time per request: 20.121 ms Requests per second: 111.93 Time per request: 8.934 ms 10.2.3 with performance patch Requests per second: 402.67 Time per request: 2.483 ms Requests per second: 3336.61 Time per request: 0.300 ms 10.2.3 with performance patch with thread pooling and keep alive Requests per second: 426.59 Time per request: 2.344 ms Requests per second: 3954.74 Time per request: 0.253 ms You can see that the difference is very significant: for the complex call, from 46 to 426 requests per second, is almost a 10x increase, for the simple code from just above 100 to almost 4,000 is just short of a 40x increase in throughput.  Summary For Embarcadero and the RAD Studio team, the RAD Server technology is a key piece of the plans and the future. Focusing on its performance was important, and more is coming in terms of Delphi RTL optimizations in the future. We have also added better support for JavaScript clients (including Ext JS) in the 10.2.x updates, and also made available a free deployment license with the Enterprise license. RAD Server is a key technology and a great way to bring your client/server applications towards the future, with a service oriented and more distributed architecture, ready for mobile and cloud deployment. Stay tuned for more.
Read More

Deep Dive: Field Service App Template For Android And iOS With RAD Studio 10.2 Tokyo

The RAD Server Field Service Template provides an end to end field service application template for routing appointments, managing parts, and user administration. It is made up of a REST server module, a desktop client, and a cross platform mobile client. The template can give you a head start in building your own field service solutions. You can download the template from within the RAD Studio IDE using Embarcadero GetIt.

Introduction

 

The RAD Server Field Service Template utilizes a RAD Server based REST server module for the server side. On the admin side there is a FireMonkey based desktop client for adding, viewing, and managing appointments. Additionally, the admin client allows you to manage parts inventory and do user administration. The offline capable cross platform client app is built in FireMonkey and it can be deployed to Android, iOS, macOS, and Windows. There is a single codebase and single UI. It allows you to view pending and completed appointments, map their locations, and mark them as completed. You can also view parts inventory and receive local notifications when new appointments are synced from the server. Both LiveBindings and FireDAC are used extensively through the Field Service Template to provide a low code solution.

The Field Service Template consists of a RAD Server backend connected to an InterBase database. RAD Service provides REST endpoints which both the Field Service Admin and the Field Service App connect to for performing CRUD operations. Additionally, there is a Field Service Setup app which you will run on the same machine as RAD Server to setup the Field Service Template database and sample data.

  • Field Service Admin

  • Field Service App

  • Field Service Server (RAD Server)

  • Field Service Setup

You should deploy and run the projects in the following order:

 

  1. RAD Server Dev Server needs to be running for the Field Service Setup app to connect to and create the user accounts.

  2. Field Service Setup app will help you set up your database, the tables and data, and your EMS user accounts.

  3. Field Service Server is a RAD Server side REST resource which both the Admin client and the App client interface with. It should be deployable on Windows and Linux through IIS, Apache, or the stand alone RAD Server (EMS) server.

  4. Field Service App is a RAD Studio FireMonkey based client application for Android, iOS, macOS and Windows. The client application should allow you to select a tenant from your RAD Server and then log in as a user. Once logged in it will download the sample appointment and parts data for your current tenant and allow appointments to be completed. Once an appointment is complete it can be submitted back to the server if there is internet access. If the Field Service App is offline it will save the changed data until it is online again.

  5. Field Service Admin is a RAD Studio FireMonkey based client application designed for desktops on Windows and macOS. The Admin app can be used to create and edit appointments, view completed appointments, create and edit parts, and create and edit users.

 

Field Service Setup


[YoutubeButton url=’https://www.youtube.com/watch?v=cT5tiPDPh3c&list=PLwUPJvR9mZHiMb6KBD-zb6uRvi6BS0HKN&index=1′]

Start: Your RAD Server Dev Server should already be setup and running.

Step 1: Set a path for your field service database. Set the path to the EMSServer database.

The Field Service database is created, used, and populated with data in Step 3.

The EMSServer database link is used to populate the drop down of Tenant ID in Step 2.

Step 2: Setup the demo users on the RAD Server using the EMS API.

You will need your EMSServer Host, Port, and Tenant ID in this step. The Setup will connect to your EMSServer and create groups and users for the template. There is a Managers group which can log into the Field Service Admin app and a Technicians group for logging into the Field Service App.

You can create Tenant IDs using this tutorial: http://docwiki.embarcadero.com/RADStudio/Tokyo/en/RAD_Server_Multi-Tenancy_Support#EMS_Multi-Tenant_Console

Step 3: Create the tables and insert the data into your field service database with the Initialize All button.

This step contains the SQL setup queries for the Field Service database. There are three tables which will be set up which are: APPOINTMENTS, PARTS, TECHNICIANS

Each table will be dropped and re-created when the queries are run (any existing data in the tables will be lost). There are also TFDMemTables containing the default data and these are copied into the InterBase tables once they have been created.

Pressing the Initialize All button will execute the SQL queries against your defined Field Service database from Step 1.

Step 4: Optional. View or reset the default data in the Field Service database.

You can view the default sample data that is inserted into the database on this step. Additionally, you could come back later and reset the data in your database with the Reset button to the default data.

Step 5: Setup the IBLite license file for the Field Service App client.

IBLite requires a license file to use. Download it from the Product Registration Portal. You can find out more about doing that here:

http://docwiki.embarcadero.com/RADStudio/Tokyo/en/IBLite_and_IBToGo_Test_Deployment_Licensing

Locate the IBLite registration file that you download from the Product Registration Portal. It may be in your Downloads directory by default. The filename will be similar to regXXXX_XXXXXXXX.txt where the X’s are numbers. The file will ultimately need to be named reg_iblite.txt.

Complete: After step 5 the databases and users should be setup and ready for you to use the client and admin areas.

Your EMS database and users should be setup at this point. You should be able to connect the Field Service package to your new field service database and compile the package.

Once your Field Service Server EMS package is running in the RAD Server Development Server you should be able to open and compile the Field Service App client.

 

After you complete some of the appointments via the Field Service App client you should be able to log into the Field Service Admin and see the completed appointments in the Service History.

Field Service Server


[YoutubeButton url=’https://www.youtube.com/watch?v=paw3nCwd_qs&list=PLwUPJvR9mZHiMb6KBD-zb6uRvi6BS0HKN&index=2′]

The Field Service Server is the RAD Server module for the Field Service App and the Field Service Admin to interface with.

The end points mainly return the FireDAC JSON format which can be easily loaded in to a RAD Studio client or access via standard JSON in a non-RAD Studio environment. FireDAC JSON can be loaded into various FireDAC components like TFDQuery and TFDMemTable using LoadFromStream and LoadFromFile.

Endpoints:

GET fieldservice/appts/:PageId – Returns FireDAC JSON containing the appointments list. For Managers it is all appointments. For Technicians it is only their current day appointments for their user account.

GET fieldservice/parts/:PageId – Returns FireDAC JSON containing the parts list.

GET fieldservice/technicians/:PageId – Returns FireDAC JSON containing the users list. For Managers it is all users. For Technicians it is only their own account.

POST fieldservice/update/appt – Receives FireDAC JSON containing an appointment ID and NOTES for an existing appointment, stores the data, and sets the appointment to completed.

POST fieldservice/appts/0 – Receives FireDAC JSON for creating or editing appointments. Returns FireDAC JSON with the IDs. Only users in the Managers group can use this endpoint. Passing an ID of 0 will create a new record while using an existing ID will edit the existing record.

POST fieldservice/parts/0 – Receives FireDAC JSON for creating or editing parts. Returns FireDAC JSON with the IDs. Only users in the Managers group can use this endpoint. Passing an ID of 0 will create a new record while using an existing ID will edit the existing record.

POST fieldservice/technicians/0 – Receives FireDAC JSON for creating or editing users. Returns FireDAC JSON with the IDs. Only users in the Managers group can use this endpoint. Passing an ID of 0 will create a new record while using an existing ID will edit the existing record.

 

DELETE fieldservice/appts/:Id – Takes the Id to be deleted as the last segment parameter in the URL and deletes the appointment record. Returns JSON. Only users in the Managers group can use this endpoint.

DELETE fieldservice/parts/:Id – Takes the Id to be deleted as the last segment parameter in the URL and deletes the appointment record. Returns JSON. Only users in the Managers group can use this endpoint.

DELETE fieldservice/technicians/:Id – Takes the Id to be deleted as the last segment parameter in the URL and deletes the appointment record. Returns JSON. Only users in the Managers group can use this endpoint.

User Permissions:

User permissions are governed by the {$DEFINE GROUPPERMISSIONS}. You can comment or uncomment this line for dev and live deployments. User permissions are ignored when {$DEFINE GROUPPERMISSIONS} is commented out.

By default there are two Groups setup which are Managers and Technicians.

Different data is returned depending on if the user is in the Managers or Technicians group. Some operations are only allowed by users in the Managers group.

Database Schema:

The FireDAC JSON format is used to pass data back and forth between the server, the Admin client, and the App client. The database schema for the Appointments, the Parts, and the Technicians tables are the same across all four applications. You can save the data from each of the application’s TFDMemTables out to file and load it into each of the other applications.

Field Service Admin


[YoutubeButton url=’https://www.youtube.com/watch?v=Y5Dex1miXj0&list=PLwUPJvR9mZHiMb6KBD-zb6uRvi6BS0HKN&index=3′]

The Field Service Admin project is built in RAD Studio Delphi using FireMonkey (FMX). The Admin app connects to RAD Server on the backend via a REST API. You should be able to log into the Admin area by selecting a Branch ID (Tenant ID) plus entering the login and password for a user in the Managers Group. For this template the default user is manager1.

Be sure to configure the EMS_SERVER and EMS_PORT const in uMainForm.pas to point at your development server. The default is localhost 8080.

The Branch ID is stored with each data table so each branch will only see its own set of appointments, parts, and users. Each branch has its own users and groups as well. The Branch system is built on top of the Tenant functionality in RAD Server.

Appointments

Appointments are records that can be created, viewed, and edited in the Admin client. They can also be assigned to a Technician. Appointments can be viewed and completed in the Field Service App. Appointments have various fields like Appointment date and time, customer title, description, address information, phone number, location, photo, status, and notes. The photo field supports PNGs and JPGs. Addresses can be converted to longitude and latitude using the Locate button utilizing the Google Geocoding API.

 

History

The Service History list is a view into the Appointments and only shows Appointments that have been their status set to Complete. Technicians using the Field Service App submit completed appointments and include notes. The History view utilizes TFDLocalSQL to show only the completed appointments.

 

Parts

Parts are records that can be created, viewed, and edited in the Admin client. They can also be viewed by Technicians. Parts have various fields like title, description, location, quantity, and photo. The photo field supports PNGs and JPGs.

 

Users

Users are records that can be be created, viewed, and edited in the Admin client. They also show up as an individual profile to logged in Technicians. When a user is created in the Field Service database it also creates a shadow user in the RAD Server Users API where their username and password are stored. By default users can be in the Managers Group or the Technicians Group. The Group information is also stored in the RAD Server Groups API and the server accesses the RAD Server User and Group data for the permissions.

 

Data Sync

The Data Sync tab in the Admin client is where JSON data is downloaded from the Field Service Server REST endpoint and loaded up into the various in memory TFDMemTable components. Data for the Appointments, Parts, Users, and Groups is all downloaded on this tab. You can also request to Refresh the data at any time to get new updates from the server. Additionally, there is a background TTimer which will refresh the data from the server automatically on an interval.

Architecture

The architecture of the app is built in a low code rapid application development style using TTabControls for handling pages and individual frames for each page. TActionList is used to consolidate much of the code in the MainForm. There are two TTabControls on the MainForm. The first one contains the Login frame and the second TTabControl. The second TTabControl contains the rest of the frames. Within the ApptsFrame, HistoryFrame, PartsFrame, and TechsFrame there are additional Master/Detail TTabControls.

If you want to make changes to the design time frames be sure to edit the frame itself and not the version of it that is embedded in the MainForm. This will keep your changes consolidated in one place. If your changes don’t update in the MainForm you can delete the Frame from the MainForm and re-add it. Be sure to add it to the correct Tab and set to Align Client after you add the frame.

The frames are built to be as modular as possible with TBindSourceDB components used as endpoints for the LiveBindings. This allows you to easily re-use the frames in your own projects by connecting the TBindSourceDBs to your own datasets.

A TFDLocalSQL component is used to provide SQL access to the various TFDMemTables via TFDQuery components. This allows the App to provide query results for filtering some of the datasets.

  • uDataModule in ‘uDataModule.pas’ {MainDM: TDataModule},
    Contains the RAD Server (EMS) Provider client components, the in memory table components, and the various FireDAC connecting components.

  • uMainForm in ‘uMainForm.pas’ {MainForm},
    Contains the main form of the application with the various TTabControls and inline embedded TFrames.

  • uLoginFrame in ‘uLoginFrame.pas’ {LoginFrame: TFrame},
    Contains the UI and code for the Login screen.

  • uApptsFrame in ‘uApptsFrame.pas’ {ApptsFrame: TFrame},
    Contains the UI and code for the Appointments screen.

  • uHistoryFrame in ‘uHistoryFrame.pas’ {HistoryFrame: TFrame},
    Contains the UI and code for the History screen.

  • uPartsFrame in ‘uPartsFrame.pas’ {PartsFrame: TFrame},
    Contains the UI and code for the Parts screen.

  • uTechsFrame in ‘uTechsFrame.pas’ {TechsFrame: TFrame},
    Contains the UI and code for the Users screen.

  • uProgressFrame in ‘uProgressFrame.pas’ {ProgressFrame: TFrame},
    Contains the activity progress TFrame which is displayed when the app is busy.

  • uTenantsDM in ‘uTenantsDM.pas’ {TenantsDM: TDataModule},
    Contains the RAD Server (EMS) Provider connector components for accessing the Branch (Tenants) list.

  • uTenantListForm in ‘uTenantListForm.pas’ {TenantForm},
    Contains the UI and code for selecting a Branch/Tenant.

  • uQueueFrame in ‘uQueueFrame.pas’ {QueueFrame: TFrame},
    Contains the UI and code for syncing data from the server.

  • uGroupsListForm in ‘uGroupsListForm.pas’ {GroupsForm},
    Contains the UI and code for selecting a Group.

  • uTechsListForm in ‘uTechsListForm.pas’ {TechsForm};
    Contains the UI and code for selecting a Technician to assign to an appointment.

Permissions

The Field Server Admin app will make an additional call after it logs in to download the list of Groups that the current user account is in. It will check to see that the user is in the Managers Group. If the user is not in the Managers Group it will log you back out. There are additional permissions in the Field Server Server which govern what data is sent down to which users as well. Only users in the Managers Group will receive the full data and be able to make changes to it.

Customize The UI

You can quickly and easily customize most of the look and feel of the app with three easy changes. In TMainForm there is a BackgroundRect, a BackgroundImageRect, and a EmeraldDarkStyleBook control. You can change the background color of the app by changing the BackgroundRect.Fill.Gradient property. You can change the image that is overlayed over the entire app by changing the BackgroundImageRect.Fill.Bitmap.Bitmap property. The background image works by being above all of the other controls, having a low Opacity, having a HitTest of False and a Locked property of True. Finally, you can change most of the rest of the theme by loading different Premium Styles into the EmeraldDarkStyleBook control.

You can customize the header logo of the Login screen on the LoginFrame. There are a few other places where the custom green color is used on some elements in the TListView controls and some the search icons using a TFillRGBEffect.

You will need to update the BackgroundRect and BackgroundImageRect in the GroupsListForm, the TechsListForm, and the TenantForm as well. There is a BackgroundImage control in the LoginFrame if want to customize the background of the Login page. Remember that you will need to load one style for each of the four deployment platforms. You can access the Premium Styles here:

https://www.embarcadero.com/products/rad-studio/fireui/premium-styles

https://cc.embarcadero.com/item/30491

Field Service App


[YoutubeButton url=’https://www.youtube.com/watch?v=SnIMq-s3EHc&list=PLwUPJvR9mZHiMb6KBD-zb6uRvi6BS0HKN&index=4′]

The Field Service App client project which is built in RAD Studio Delphi using FireMonkey (FMX). The client is targeted for deployment to Android, iOS, macOS, and Windows. The Field Service App client connects to RAD Server on the backend via a REST API. You should be able to log into the App client by selecting a Branch ID (Tenant ID) plus entering the login and password for a user in the Technicians Group. For this template the default users are technician1 and technician2.

Be sure to configure the EMS_SERVER and EMS_PORT const in uMainForm.pas to point at your development server. The default is localhost 8080.

The Branch ID is stored with each data table so each branch will only see its own set of appointments, parts, and users. Each branch has its own users and groups as well. The Branch system is built on top of the Tenant functionality in RAD Server.

Appointments

Appointments are records that can be viewed in the Field Service App client. When you are logged in as a Technician you will only see appointments assigned to you, marked as pending, and with a date of today. Appointments have various fields like Appointment date and time, customer title, description, address information, phone number, location, photo, status, and notes. You can view a static map of the address of the appointment plus you can press a Locate button to bring up an interactive map of the address. You can also click on the phone number on a mobile device and it will launch the call functionality of the device. Technicians can enter notes about an appointment and mark it as complete. The notes and status change are sent to the server.

 

History

The Service History list is a view into the Appointments and only shows Appointments that have been their status set to Complete for this technician for today. Newly completed records show up in the History tab even if they have not yet been synced with the server yet.

 

Parts

Parts are records that can be viewed in the Field Service App client. Parts have various fields like title, description, location, quantity, and photo. Parts are not editable in the Field Service App but the data does get updated when synced from the server.

 

Profile

The profile section shows the current Technician that is logged into the Field Service App and their various information. You can also choose to disable the local notifications here. Profile information also shows up in the TMultiView menu.

 

Notify

The notify section shows new appointments that have been downloaded from the server that have not yet been viewed by the current technician. Choosing a notification here will take you to the appointment for that notification. Local notifications are also implemented and when new appointments are received local notifications will be sent to the device. The notification functionality is built so that you can implement your own remote notifications using the same system if needed.

 

Data Sync

The Data Sync tab in the Field Service App client is where JSON data is downloaded from the Field Service Server REST endpoint and loaded up into the local IBLite database. Data for the Appointments, Parts, and Technician is all downloaded on this tab. You can also request to Refresh the data at any time to get new updates from the server. Additionally, there is a background TTimer which will upload and sync the completed data from the Field Service App automatically on an interval. A cloud icon will appear in the upper left of the Field Service App when there is data to be synced in the queue.

Architecture

The architecture of the app is built in a low code rapid application development style using TTabControls for handling pages and individual frames for each page. TActionList is used to consolidate much of the code in the MainForm. There are two TTabControls on the MainForm. The first one contains the Login frame and the second TTabControl. The second TTabControl contains the rest of the frames. Within the ApptsFrame and the HistoryFrame there are additional Master/Detail TTabControls.

If you want to make changes to the design time frames be sure to edit the frame itself and not the version of it that is embedded in the MainForm. This will keep your changes consolidated in one place. If your changes don’t update in the MainForm you can delete the Frame from the MainForm and re-add it. Be sure to add it to the correct Tab and set to Align Client after you add the frame.

The frames are built to be as modular as possible with TBindSourceDB components used as endpoints for the LiveBindings. This allows you to easily re-use the frames in your own projects by connecting the TBindSourceDBs to your own datasets.

  • uDataModule in ‘uDataModule.pas’ {MainDM: TDataModule},
    Contains the RAD Server (EMS) Provider client components, the in memory table components, the IBLite tables, and the various FireDAC connecting components.

  • uMainForm in ‘uMainForm.pas’ {MainForm},
    Contains the main form of the application with the various TTabControls and inline embedded TFrames. Additionally, it includes the TNotificationCenter.

  • uLoginFrame in ‘uLoginFrame.pas’ {LoginFrame: TFrame},
    Contains the UI and code for the Login screen.

  • uApptsFrame in ‘uApptsFrame.pas’ {ApptsFrame: TFrame},
    Contains the UI and code for the Appointments screen.

  • uHistoryFrame in ‘uHistoryFrame.pas’ {HistoryFrame: TFrame},
    Contains the UI and code for the Service History screen.

  • uPartsFrame in ‘uPartsFrame.pas’ {PartsFrame: TFrame},
    Contains the UI and code for the Parts screen.

  • uProfileFrame in ‘uProfileFrame.pas’ {ProfileFrame: TFrame},
    Contains the UI and code for the Profile screen.

  • uNotifyFrame in ‘uNotifyFrame.pas’ {NotifyFrame: TFrame},
    Contains the UI and code for the Notification screen.

  • uProgressFrame in ‘uProgressFrame.pas’ {ProgressFrame: TFrame},
    Contains the activity progress TFrame which is displayed when the app is busy.

  • uTenantsDM in ‘uTenantsDM.pas’ {TenantsDM: TDataModule},
    Contains the RAD Server (EMS) Provider connector components for accessing the Branch (Tenants) list.

  • uTenantListForm in ‘uTenantListForm.pas’ {TenantForm},
    Contains the UI and code for selecting a Branch/Tenant.

  • uQueueFrame in ‘uQueueFrame.pas’ {QueueFrame: TFrame},
    Contains the UI and code for syncing data from the server.

  • uWebBrowserForm in ‘uWebBrowserForm.pas’ {WebBrowserForm};
    Contains the UI and code for viewing real time map data in a TWebBrowser.

Offline Caching

The Field Service App is able to work offline once you have logged into your account at least once. The next time you log into the app it will use your previous RAD Server Session ID for any new connections it tries to make to the server. The data from the server is cached as JSON files and stored in the IBLite database. The Appointments are saved as appts.json, the Parts as parts.json, the Techs as technicians.json, and the Tenants as tenants.json. If no connection to the server is available the data will be loaded from those files instead. Additionally, if there is no internet connection it will save the appointments and notes that you have marked completed in the History table of the IBLite database. When the next time an internet connection is detected it will upload those changes.

The Field Service App has a local History table where is stores the local changed state of the Appointments. Even if you re-sync the data from the server and your changes have not been uploaded yet it will apply your existing local changes to this new data until which time it is able to upload the changes to the server.

If you log out of the existing account the local database is deleted until you log in again. If you log out before uploading your changes then you changes would be lost.

Notifications

The local notification functionality built into the Field Service App relies on the cross platform  TNotificationCenter component that is built into RAD Studio. There is a local IBLite Notify table in the Field Server App where it stores the current state of notifications (whether the user has viewed them already and whether they have been sent to the user’s platform).

When a new Appointment is downloaded from the server during a data sync a new record is added to the IBLite Notify table. A notification is sent to the platform through the TNotificationCenter when this happens. The user can view the notification by clicking on the record on the Notify tab. Once a notification is viewed it will no longer be displayed on the Notify tab.

Each platform handles notifications differently. You should be able to hook up remote notifications as well through this existing local notification system.

Customize The UI

You can quickly and easily customize most of the look and feel of the app with three easy changes. In TMainForm there is a BackgroundRect, a BackgroundImageRect, and a EmeraldDarkStyleBook control. You can change the background color of the app by changing the BackgroundRect.Fill.Gradient property. You can change the image that is overlayed over the entire app by changing the BackgroundImageRect.Fill.Bitmap.Bitmap property. The background image works by being above all of the other controls, having a low Opacity, having a HitTest of False and a Locked property of True. Finally, you can change most of the rest of the theme by loading different Premium Styles into the EmeraldDarkStyleBook control.

You can customize the header logo of the Login screen on the LoginFrame. There are a few other places where the custom green color is used on some elements in the TListView controls and some the search icons using a TFillRGBEffect.

The Profile screen for the technician has a background image in the ProfileFrame called HeaderBackgroundRect plus a BackgroundRect control. The Profile is also displayed in the TMultiView control on the MainForm with another control named HeaderBackgroundRect as well. Change the Fill.Bitmap.Bitmap property on both controls.

You will need to update the BackgroundRect and BackgroundImageRect in the WebBrowserForm and the TenantForm as well. Remember that you will need to load one style for each of the four deployment platforms. You can access the Premium Styles here:

https://www.embarcadero.com/products/rad-studio/fireui/premium-styles

https://cc.embarcadero.com/item/30491


[YoutubeButton url=’https://www.youtube.com/watch?v=GrHdj_4ACxg&list=PLwUPJvR9mZHiMb6KBD-zb6uRvi6BS0HKN&index=5′]

Read More

Read More

CodeRage 8 replays: REST stuff

It seems I forgot to schedule this post, as it was still in the drafts.. So here it is for historic purposes. Likely a few links have died by now. Last year I could not make it to CodeRage 8 as I was prepping for EKON 17 and ITDevCon 2013. But there were some nice presentations, some of which I really wanted to see again. So I was glad to have found the CodeRage 8 Replays: http://www.youtube.com/playlist?list=PLwUPJvR9mZHiaYvH9Xr7WuFCVYugC4d0w. Especially for these sessions as REST support is an under-marketed aspect of Delphi XE5: Oct 16, 9am – The New REST Client Library, A Tool of Many Trades – YouTube. Oct 16, 10am – The New REST Client Library, Dive into the Details – YouTube. And a few others as well: Oct 16, 1pm – Responsive Delphi Design – YouTube. Oct 16, 11am – Deep Dive Into Creating Android Apps – YouTube. Oct 15, 1pm – Beyond The App – YouTube. Oct 15, 2pm – Devices and Sensors in IOS and Android – YouTube. Oct 16, 8am – From Idea to Submitted Mobile App in 30 Minutes – YouTube. Oct 15, 8am – CodeRage 8 Delphi – A VCL Developers Guide To FireMonkey – YouTube. Oct 15, 10am – Designing Common User Interfaces for iOS & Android – YouTube. Oct 15, 5pm – Real Mobile Implementation Patterns – YouTube. Oct 15, 11am – LiveBindings and Rapid Prototyping – YouTube. Oct 17, 9am – Secure Database Storage for Mobile and Desktop – YouTube. Oct 17, 11am – Introducing TMS Aurelius, a Delphi ORM – YouTube. Oct 17, 2pm – Caching Updates with FireDAC – YouTube. Oct 15, 12pm – Introduction to iOS and Android Devices connecting to a DataSnap Server – YouTube. Oct 16, 6am – DataSnap Architectures, Optimizations, and Use Cases – YouTube. Oct 16, 7am – Secure DataSnap Development – YouTube. Oct 15, 3pm – Common Delphi Coding Anti-Patterns – YouTube. Oct 17, 5pm – Developing Windows & Android Apps with Mitov Software Component Libraries – YouTube. –jeroen
Read More

Embarcadero’s June 2018 Cool App Winner is MalyKangurek POS

Years ago I worked at a company that maintained a Point of Sale (POS) system written in Delphi. I wasn’t involved in that project (I was developing a medication management system for an assisted living facility), but talking with some of the developers that were working on it I learned that Delphi is very popular in many different vertical markets, specifically Point of Sale systems. So I’m not surprised to see MalyKangurek POS by SoftSystem as the cool app winner for June 2018.

What makes MalyKangurek POS cool is that it is designed specifically around a children’s playground with features designed for that specific business niche. It has all the standard POS features including the ability to work with hardware devices like barcode readers, cash drawers, and receipt printers. Additionally it is designed to work great on a touch screen with nice big buttons and on screen input.

  

 

Originally it was created in Delphi 2009 with VCL components, and now it is transferred to the latest Delphi and the FireMonkey platform. It started out targeted the Windows desktop, but now that it is migrated to FireMonkey there are plans to make it available on Android in the future.

Beyond FireMonkey it also makes use of FireDAC for database access, Devart SDAC, TMS Software Components, AlphaSkin, FastReport, EurekaLog, CPort.

When I asked Osmański Przemysław of SoftSystem, the developer of MalyKangurek POS to tell me more about his use of Delphi he said the following:

“Delphi is a great environment for creating applications. I started to play with Delphi in the days of Delphi 2. Later Delphi became my work environment and all the applications I created were created in Delphi. For many years Delphi was the only real visual tool for creating applications. Its advantages are the speed of compilation and the ability to compile to different platforms. In addition, the Delphi community in Poland is very large and helpful to other programmers.

In developing MałyKangurek I learned about external devices such as barcode readers, receipt printers, fiscal printers, time meters etc.The application was written for my wife and her business, but with time it has become an application used in many places. As users made suggestions Delphi made it very quick and easy to make changes and features.

For a while I started developing some of my new software in Visual Studio. Then Delphi 10 (Seattle, Berlin and Tokyo) brought new quality when compared to earlier versions. Now I do not have to worry about changing development tools, and I can devote myself to the pleasure of writing a new cross-platform version of the application in an environment that i know well and like.

Now all my software is developed with Delphi. There are so many new solutions for Delphi, such as UniGUI which allows for seamless development of web applications. I look forward to the future of development with Delphi that will allow me to continue to work with the pleasure that I’ve had so far.”

Watch MalyKangurek POS video in action here:

[YoutubeButton url=’https://www.youtube.com/watch?v=SWjekG5ECCc&t=12s’]

 

Interested in submitting for the Embarcadero’s Cool App contest? It’s open to any business or consumer application built with RAD Studio, Delphi or C++Builder. Embarcadero awards Cool App contest winners a $500 Amazon gift card and winning submissions are also highlighted on the company’s YouTube channel. For more information on the contest and a link to the submission form click here.

Read More

Read More

Delphi Blogs of the Month #60

It has been a while, again, but I'm back with a collection of relevant and notable links of the recent weeks. All of these are interesting reads and worth checking in case you have missed them. Official Embarcadero Updates Idera Adds Web App Text Editing through Froala Acquisition at https://www.businesswire.com/news/home/20180619005348/en/Idera-Adds-Web-App-Text-Editing-Froala​ Technical Blog Posts Removing the Community toolbar by David at https://community.embarcadero.com/blogs/entry/removing-the-community-toolbar Editor Views in RAD Studio by David at http://www.davidghoyle.co.uk/WordPress/?p=1905 Chet – A C Header Translator powered by Clang by Erik of Grijjy at https://blog.grijjy.com/2018/05/29/chet-a-c-header-translator-powered-by-clang/ Using an IDE: Getting back to code faster by Mary helps us get back the the basics of why we us an IDE for our daily work: https://community.embarcadero.com/blogs/entry/using-an-ide-getting-back-to-code-faster ​RAD Server Solution Series: [Field Service Application] by Sarina at https://community.embarcadero.com/blogs/entry/rad-server-solution-series-field-service-application Using Apple’s Grand Central Dispatch and Android’s ScheduledThreadPoolExecutor for Delphi timers by Allen of Grijjy at https://blog.grijjy.com/2018/05/20/using-the-apples-grand-central-dispatch-and-androids-scheduledthreadpoolexecutor-for-delphi-timers/ Targeting Android 8 and higher by (another) David at http://delphiworlds.com/2018/05/targeting-android-8-and-higher/ (this is an important and urgent area, we are working on this actively) Open files in external apps from FireMonkey by Sergey at https://www.code-partners.com/open-files-in-external-apps-from-firemonkey/ Use the Source! by Jim at https://community.embarcadero.com/blogs/entry/use-the-source ​Libraries Quite interesting: Delphi LeakCheck at https://bitbucket.org/shadow_cs/delphi-leakcheck Tech Business Interesting article on "Open source sustainability" by Tech Crunch at https://techcrunch.com/2018/06/23/open-source-sustainability/. The topic is certainly debatable, but the article raises some interesting points. When multi-million dollar tech giants rely on open source and don't contribute to it, it is a sign things are out of control. Of course, that's not always the case. Another strong and interesting article, Case Sensitivity is an Anti-Pattern by Chad at https://www.kudzuworld.com/articles/casesensitivity/. I'm not 100% convinced, as much as a like case insensitive languages ;-) Up to next month.
Read More

RAD Studio 10.2.3 Delphi CodeInsight (and iOS 11.3) Patch

Over the last few months we were able to investigate some very specific CodeInsight bugs (with reproducible cases) and we have been able to work on several fixes to the Code Completion and other areas. A critical one involved the case a developer overaloads a generic method. While some of the fixes will be part of the next major release, some of them could be made available for the 10.2.x product and are included in this patch. One of the issues is purely a compiler issue a customer reported. At the same time we have done some further cleanup to the iOS 11.3 patch we have released last month, and having also to include new compiler support in PAServer, we have decided to merge the iOS fixes and thd code insight fixes in a single download -- so you don't end up with a partially patched, unstable system. The download is avaialble for registered users of any paid version at: https://cc.embarcadero.com/item/30837 The iOS-related publicly reported issues addressed by the patch are: RSP-20268: [DCC Error] E2597 ld: file not found: /usr/lib/system/libcache.dylib for architecture arm64 RSP-20303: XCode 9.3 and iOS 11.3 linker error RSP-20342: A blank project of Delphi Tokyo 3 Don't compile in iOS RSP-20346: Compiling error with SDK11.3 for iOS, XCode 9.3 The CodeInsight related issues include: RSP-16046: [Regression] [Code Completion] Code completion dialog does not show up in overloaded method RSP-14877: IDE freezes RSP-17412: Code completion failure RSP-19856: Code completion failure SY12895 RSP-19508: Code completion
Read More

Signing Windows Delphi Applications

FireMonkey Apps for iOS and Android are signed automatically by Delphi during the build process – this is an obligation esp. for iOS apps and thus has been added as a feature directly into the IDE. For Windows applications though (32 or 64, VCL or FMX) there is no such… Read More Der Beitrag Signing Windows Delphi Applications erschien zuerst auf Developer Experts.
Read More

BVS Solitaire Collection is Embarcadero Cool App Winner for May

 

Anyone who loves playing with deck of cards knows solitaire. And no matter how advanced the technology is, it will always be played. That is why I’m thrilled to see BVS Solitaire Collection by BVS Development as our May 2018 cool app winner. It is an award-winning multi-featured collection of solitaire card games that includes over 510 variations.

It features both old-time favorites (like Spider Solitaire, FreeCell and Pyramid) and original variations not found elsewhere. You can modify rules of any game, thus easily creating your own unique variations. Attractive smoothly scalable playing cards, completely customizable game appearance and comprehensive set of statistics to measure your performance. Its Windows version gained popularity and was even featured in a movie “The Girl with the Dragon Tattoo” (2011).

 

   

BVS Solitaire Collection is built with Delphi along with Firemonkey. It runs on iOS, MacOS and Windows. Boris of BVS Development Corporation shared his experience on Delphi, he said: 

“Delphi was chosen due to the flexibility of Object Pascal and both powerful and convenient development environment. I like the aesthetics of the Object Pascal code and its high readability. When I’m in an edit-compile- debug cycle I want it to be as fast as possible. Delphi compiler is extremely quick. That accelerates my development efforts and greatly improve my productivity. Besides, Object Pascal is much simpler and safer than C++ which further improves productivity and code maintainability. Embarcadero keeps adding new features continuously. Actually Delphi is one of the best IDEs on the market, that can be used to create cross platform applications.”

 

Watch BVS Solitaire Collections video in action here: 


 

Interested in submitting for the Embarcadero’s Cool App contest? It’s open to any business or consumer application built with RAD Studio, Delphi or C++Builder. Embarcadero awards Cool App contest winners a $500 Amazon gift card and winning submissions are also highlighted on the company’s YouTube channel. For more information on the contest and a link to the submission form, click here.

Read More

Read More

One more reason to have an ARC win32 compiler: tracking down memory leaks efficiently

One of the reasons it is so hard to write ARC a compatible source base is that there is no Delphi ARC win32 compiler. So you have to debug your memory issues using the remote debugging capabilities which – besides very slow – are unstable at best. This is the number 1 reason I have […] … Read More

Read More

Delphi 10.2 Tokyo: they did not fix the broken documentation tab in 10.2.2 2004, but it is an “easy” fix to do yourself

Since the fix is on the forums server (singular!) and that one tends to be squirrel driven lately, here it is in full via [WayBack] I see they didn’t fix the broken documentation tab in 10.2.2 2004 (professional). It’s not a show stopper but a nuisance to fix oneself. And for new dev… – Herbert […] … Read More

Read More