Ontdek Delphi 11.2 Alexandria

De nieuwe Delphi 11.2 Alexandria release is uit en we zijn blij met deze versie. We gaan samen met Barnsten in een webinar niet alleen de nieuwe features bekijken, maar er ook enkele uitproberen met demo’s.

Wanneer?
Donderdag 22 september 2022 van 09.30 tot 10.30 uur.

Waar?
Het webinar is online, registreer je nu hier:
https://www.barnsten.com/nl/ontdek-delphi-11.2-alexandria/

Waarom?
Maak niet alleen kennis met de nieuwe features en mogelijkheden van Delphi 11.2  Alexandria maar zie ook hoe je ze kunt toepassen. In dit webinar zie je op welke manier de nieuwe IDE features gebruikt kunnen worden in een development team en welke wijzigingen relevant zijn voor nieuwe en bestaande Delphi projecten. Tijdens en direct na afloop van het webinar kunt via de chatbox vragen stellen.

Teasers?
In dit webinar zie je hoe je local GetIt kunt gebruiken, hoe je Help Insight tags kunt toevoegen, met als bonus voor de deelnemers de primeur van een comic plug-in voor de Welcome Page.

Android SDK for Delphi 11.2 Alexandria

The Android SDK is an optional feature in the Delphi installation. Now if you did not select it in the install, you can add it later using the Tools – Manage Platforms menu in the Delphi IDE. If you do that, then you should also check the Eclipse Temurin OpenJDK 11 (Hotspot) JVM, for the Java bits the Android SDK needs.

If you forgot that, no worries, the Delphi IDE has an automatic feature to detect missing Android SDK files. So if you start an Android project and then hit compile you will get a question from the Delphi IDE “Would you like to update the platforms SDK now?” Just click yes and it will then download the Android SDK for you and you can just continue.

Would you like to update the platforms SDK now?But occasionally the install process of Delphi fails to download some of the required Android SDK files from Google. There are many reasons for this, sometimes the Google servers are down or there is a conflict with an existing Android SDK. You can easily confirm issues using the Delphi SDK Manager, that you can open through the Tools – Options menu. Under the Deployment branch you’ll find the SDK Manager.

Android SDK manager fro Delphi 11.2The missing folders are indicated with yellow danger signs next to them. In this case we are missing

  • build-tools 32.0.0
  • platform-tools
  • platforms android-32

The solution here is to open an administrative command prompt and navigate to the Android SDK advmanager.bat folder as you can see in the SDK manager screen:


CD "C:\Users\Public\Documents\Embarcadero\Studio\22.0\CatalogRepository\AndroidSDK-2525-22.0.46141.0937\cmdline-tools\latest\bin"

In that folder we need to use the sdkmanager.bat file to download and install the missing items.


sdkmanager "build-tools;32.0.0"
sdkmanager "platform-tools"
sdkmanager "platforms;android-32"

You can also list all the available items that you can download and install in from Google.


sdkmanager --list

More information on the sdkmanager can be found on the android developer website: https://developer.android.com/studio/command-line/sdkmanager

That should fix it all up!

As a sidenote; with the newer Windows 10 and 11 versions the Android ADB driver comes pre-installed, and you just have to enable developer mode and connect your Android device with an USB cable to get Windows to install the Android Debug Bridge driver.

Delphi (H)Appy Hour – 24 augustus 2021

Delphi Happy Hour juichende ontwikkelaarAltijd al eens een Android App willen maken?

In deze korte demo op 24 augustus 2021 om 16:00 uur neem ik je mee in de wereld van app ontwikkeling met Delphi. Aan de hand van een heldere nederlandstalige demo zie je hoe eenvoudig dit is met Delphi. Met een paar stappen configureer je Delphi en je laptop en voor je het weet staat je eerste cross-platform app op je telefoon. Je kunt tijdens de demo mee ontwikkelen, zodat je ook zelf je eigen app op je telefoon hebt. Vragen? Die kun je tijdens de sessie via de chat stellen zodat je direct je antwoord hebt.

In Delphi ontwikkel je trouwens voor iOS, Android, Windows en Mac vanuit één broncode, dus exact diezelfde app kun je ook daar installeren.

Schrijf je hier in voor deze Zoom sesie samen met Barnsten : https://www.barnsten.com/nl/delphi-happy-hour/

Online Delphi FireMonkey en Android Power training – 4 en 5 maart 2021

Altijd al een App willen maken in Delphi? Schrijf je dan nog deze maand in voor de online Delphi FireMonkey en Android Power training.

In de eerste dag, op 4 maart, behandelen we het FireMonkey framework. De aanpassingen ten opzichte van het VCL framework en de best use scenario’s voor het maken van een nieuwe FireMonkey desktop application. Denk aan visualisatie, het gebruik van livebindings (loose coupling) en asynchrone execution om de GUI snel en responsive te houden.

In de tweede dag, op 5 maart, gaan we over naar mobile development. Een deel van de training is algemeen voor Delphi mobile App development, met als focus Android development. Hiervoor is een voor Delphi development geschikt Android device noodzakelijk, zie hier voor de requirements. Download ook eventueel vooraf aan de training de benodigde USB debug drivers voor je Android device. In de training behandelen we mobile templates, local storage, maar ook web services en interactie met Java en het nieuwe permissions framework van Android.

De training kan gevolgd worden met Delphi 10.4 Professional of Community Edition. Voor Android 11 compatibility raden we de laatste versie aan van Delphi 10.4. In een klein deel van de training is er een keuze tussen Delphi 10.4 Enterprise code of Delphi 10.4 Professional code.

De training zelf doen we online in Microsoft Teams. Je kunt deelnemen vanuit een web browser (Edge of Chrome), maar je kunt ook de Microsoft Teams client installeren voor meer mogelijkheden. Tijdens de training is ook 1 op 1 overleg met de trainer mogelijk. Delen van video is gezellig, maar uiteraard niet verplicht. Verder ontvangt u per post een hardcopy van het trainingsmateriaal.

Inschrijven kan tot en met 28 februari:
https://www.barnsten.com/nl/product-categorie/embarcadero-tools-nl/trainingen-nl/

5 quick tips for removing ARC in Delphi Sydney

With the release of version 10.4 Sydney, Delphi has officially moved away from the ARC memory model in the mobile compilers. This was announced in 2018, there is some nice background info in this blog post by Marco Cantu.

So how do you do a quick check if your Delphi mobile code has ARC dependencies you should fix?

Tip #1 – Run on Windows with ReportMemoryLeaksOnShutDown := True

This instructs the FastMM memory manager to report memory leaks. Simply run your iOS or Android App on Windows (with the Windows Platform active), perform the usual actions an end-user would perform and close the application. Any memory leaks will be reported and should be fixed.

In your application source code add this line:

 
begin
  ReportMemoryLeaksOnShutdown := True;
  Application.Initialize;
  Application.CreateForm(TFormMain, FormMain);
  Application.Run;
end.

If you have a memory leak a message like this will popup after closing the application.

Unexpected Memory Leak

Tip #2 –  Search | Find In Files (Shift-Ctrl-F) for any “.Create” code

Most ARC (Automatic reference Counting) code should be changed to CTFF (Create Try Finally Free). Just check if there is a try-finally and a free directly after the .Create. Not all Create code needs a try-finally-free, as some instances are owned by their container, for instance in a TObjectList<T> that may take ownership of the instantiated object.

Change this ARC code

 
procedure DoSpellCheck;
var 
  Harry: TWizard;
begin
  Harry := TWizard.Create; 
  Harry.SpellCheck;
end; 

To this CTFF code

 
procedure DoSpellCheck; 
var 
  Harry: TWizard; 
begin
  Harry := TWizard.Create;
  try
    Harry.SpellCheck;
  finally
    Harry.Free;
  end;
end;

Some code can not be easily changed from ARC to CTFF, mostly due to the Free needing to be called at some unspecified time in the future, which for instance is common in multi-threaded code. If this applies to you then you could take a look at smart pointers in Spring4D using Shared.Make(TObject.Create), or take a look at the new custom managed records which where introduced in Delphi 10.4. Both options enable you to use ARC style freeing of resources, within the now default unified memory model.

Tip #3 – Use a tool to check for memory leaks

The code in tip #1 uses the built-in FastMM4 and is free. There is also a dual-license newer version FastMM5, both are however limited to Windows. Luckily there is a nice and simple free library called leakcheck that does this for all Delphi platforms. Alternatively, if detecting leaks in Windows only is preferred, the commercial DeLeaker has a lot of options and easy overview of memory leaks. A nice summary of these tools and more can be found in the blog post of Wagner Landgraf.

Tip #4 – Check for platform specific code

The short check for memory leaks under the Windows platform will skip platform specific code for Android and iOS, so you should check for compiler directive based platform dependencies {$IFDEF ANDROID}, {$IFDEF IOS}, but also for run-time dependencies like with TOSVersion.TPlatform.pfiOS and TOSVersion.TPlatform.pfAndroid. Note that the compiler directive AUTOREFCOUNT has been removed in Delphi 10.4, but its entirely possible you used this in your own code to check for ARC availablity.

Tip 5 – Check for weak references

These are mostly introduced to enable multiple references to instances without affecting reference count in combination with ARC. Do not just remove them, they can also be used for other reference counted data structures which may not have anything to do with ARC perse.

Even without ARC, reference counting still exists in Delphi. The compiler will still automagically reference count interfaces and strings. The same mechanism is also used for the new custom managed records.

RAD Studio 10.4 Sydney Webinar 16 juni 2020

View of Sydney Harbour

Barnsten organiseert een RAD Studio 10.4 webinar op 16 juni om 14:00 waarbij ik de mogelijkheid krijg om enkele van de nieuwe features van Delphi 10.4 wat uitgebreider te laten zien. Nu ben ik best blij met de nieuwe versie dus die kans laat ik niet voorbij gaan.

Onderwerpen zijn  de werking en voordelen van per control VCL Styling, het hoe en wat van de nieuwe Delphi Language Server Protocol server voor Code Insight en de ins en outs van Managed Records en het uitfaseren van ARC (Automatic Reference Counting) op de mobile platforms. Er zit nog wel meer in qua onderwerpen, maar die kom je vanzelf tegen als je het webinar volgt.

Meer info en inschrijven kan met deze link::

Ontdek RAD Studio 10.4 Sydney – Webinar 16 juni – 14.00 uur

Tot volgende week dinsdag bij de Q&A !

Delphi 10 Parallel Programming Training – 10 en 11 juni 2020 (verplaatst)

Altijd al willen weten hoe je al die CPU cores voor je kunt laten werken in Delphi?

In deze twee daagse training gaan we gebruik maken van de System.Threading bibliotheek in Delphi, ook wel de PPL, Parallel Programming Library genoemd.

We starten eenvoudig met TTask en TFuture en TParallel.For en breiden dan uit naar hoe je dit eenvoudig, robuust en zonder dead locks toepast in je database verbindingen, communicatie met webservices en andere taken die je asynchroon wilt uitvoeren.

Maak je applicatie meer responsive en gebruik die cores!

De training is ingepland voor 10 en 11 juni bij het jachthuis te Doorn (nabij Utrecht).
Dit event is verplaatst in verband met het corona virus en wordt later opnieuw ingepland.

https://www.barnsten.com/nl/product-categorie/rad-studio-tools-nl/parallel-programming-training/

Coderage 2018 – Building Microservices and Progressive Web Apps (PWA) with Delphi

Thank you for attending my Coderage 2018 session on Building Microservices and Progressive Web Apps (PWA) with Delphi and TMS WebCore.

If you want to replay the session, please visit the Coderage 2018 page on Embarcadero Academy.

Please find the download with source and slides here:
Download source and slides
The download has been compressed with RAR with password coderage2018
and has the following SHA-256 checksum
19cb86c5d401c55fe347a6adca1ed79f9dec4f7167e62d3f064e4cc617aa90aa

Have fun creating your own REST microservices and PWA‘s!

Note: with newer versons of TMS WebCore you may need to change two lines of code in the file UnitJSONHelper.pas.


Weblib.REST, Weblib.JSON;


lArray := lJSONObject.GetJSONValue('result');

Additionally the no longer needed WebRunner lines in the Project file TheCounterWeb.dpr should be automatically removed when you open the project, if not remove them manually.

CodeRage 2018 – 4-6 December 2018

CodeRage 2018 is just around the corner!

CodeRage2018

CodeRage2018

The complete schedule:
https://www.embarcadero.com/coderage-2018

This CodeRage I’m showing you how to build microservices and how to consume them from desktop, Android mobile and using a HTML / JavaScript web app. The web app uses TMS WebCore and PAS2JS, but goes beyond basic coding as it also shows you how to convert the web app to a Progressive Web App, or PWA for short

The boilerplate code is of course available for download, please use it to jump start your own software.

Oh, and the nice thing about PWA, an Android device will offer the user the option to install the web app as an actual app with an icon on the start screen. Good stuff!

Register here, it’s free but infinite value for money:
https://www.embarcadero.com/coderage-2018

Delphi Meetup Web Development bij TMS op 12 juni 2018

Het is al bijna zover, de volgende Delphi Meetup. Dit keer in Wevelgem op het kantoor van TMS Software.

Bruno Fierens laat zien hoe je vanuit de Delphi IDE, met de Delphi taal en componenten, op een een RAD manier web user-interfaces kunt bouwen. Ook zie je hoe vanuit die Delphi web applicaties op eenvoudig bestaande Javascript libraries, zoals bijvoorbeeld jQuery, gebruik kan worden gemaakt van user-interface controls. Als laatste laat hij zien hoe dit samen met Delphi databinding te gebruiken is..

In aansluiting op de sessie van Bruno combineert Danny Wind in een use case een aantal technologieën om je te laten zien hoe eenvoudig het is om gebruik te maken van RADical Web. Danny zal een op REST gebaseerde micro-service back-end gebruiken en een  front-end die zowel RADical Web als Apps (Android/iOS) gebruikt. En dit alles gewoon met Delphi Code!

Meer info vindt je hier:
https://www.barnsten.com/nl/events/details?events_id=323