Archiv des Autors: Michael

Über Michael

Querdenker, Software-, Web-, Sound-Designer

FAF – FireMonkey App Framework – Basics

Some basics of the framework

  • Application.Mainform is the one and only „MainWindow“ which is visible throughout the lifecycle of an app
  • „MainWindow“ is used as a container for any other „view“ of the app
  • a view is a layout carried by hidden form which is created / disposed as needed
  • use of TForm as container for easy definition of layouts per device in IDE
  • a view is displayed by changing parent to „MainWindow“
  • going down in view hierarchy a view is put on a „history“ stack
  • going up in hierarchy current view is disposed and view on top of „history“ stack is displayed
  • „Back“ button is checking for special handling by a view before stack
  • view templates: splash, login, about, settings, main, list, image etc
  • on startup all necessary views are registered with an alias, formclass, etc

work in progress

  • notifications
  • preferences
  • persistent settings
  • application events
  • SQLite integration
  • multi language

Delphi 10.x :: THTTPClient replaced with Indy

After all this trouble – minimum 4 weeks lost – I replaced THTTPClient with Indy TidHTTP. Not too much work and the basics worked within an hour or two.
One new problem introduced by Indy was that TidMultiPartFormData did not work as expected. For a quick solution wrote data in a TStringStream and sent instead.

SideEffect: The app did not work when compiled in 10.1 Berlin. Now it does !

Delphi 10.0 :: Trouble with THTTPClient on iOS

Have an app which is working 100% on Android devices (no REST backend):
querying JSON data, fetching/uploading logos and images.
But on iOS we ran into big troubles:

  • chunk data sent as TStringStream led to exceptions on server like this
    „Exception EConvertError: Invalid URL-encoded char (%Yπ) at position xx“
    (TMemoryStream did not help, but base64 encoding did)
    Android doesn’t but iOS does URL-encoding with chunk data
  • any HTTP parameter is logged on server like this
    name=““Session“““ with multiple double quotes
  • changing to a TMemoryStream result looks like this
    name=“Session“&dXhBzWbuc6qN1Rfx&
  • but same example on Android
    Session=dXhBzWbuc6qN1Rfx

It is quite difficult to debug and a time consuming process, but I will try.

Delphi 10.x :: FireMonkey Cross-platform

Still working on problems with chunked file upload. Really crazy how much time is wasted with problems by different handling of HTTP in components and/or platforms.

I think that there still are quite a few bugs in FireMonkey internal but making demos to reproduce problems would need an huge amount of time (weeks or even months) I am not willing to invest as everyone I need to earn money for living.

But I will gather all infos and post them here.

Delphi 10.x :: MSBuild, rsvars.bat and BDSCOMMONDIR

MSBuild uses ..\Studio\XX.0\bin\rsvars.bat to set the environment and quite a few people seem to use MSBuild for many things ( I admit I never directly used it yet).

One task it is used for is installation of packages (like TMS Subscription Manager does for example) . And here comes the pitfall:
If you changed  BDSCOMMONDIR  (where Bpls, Dcps etc are saved in sub folders) in options this change is not reflected in rsvars.bat, it still uses the standard path.

Edit:
As Uwe Raab mentioned in a comment on google+  – and I add this for clarification – Bpl’s, Dcp’s are stored in subfolders of BDSCOMMONDIR as defined on the library page for each platform. I just override BDSCOMMONDIR to move everything away from my C:\ drive and I would except from an IDE that a change in one place of environmental settings is reflected everywhere.
But this again might be „by contract“ or „by design“.</sarcasm off>

Delphi 10.1 :: Font.Style internal (*.fmx) replaced by StyleExt

This is a label in FireMonkey in 10.0 Seattle

[Delphi]
object Label1: TLabel
Align = Center
AutoSize = True
StyledSettings = [Family]
Size.Width = 79.000000000000000000
Size.Height = 24.000000000000000000
Size.PlatformDefault = False
TextSettings.Font.Size = 18.000000000000000000
TextSettings.Font.Style = [fsBold]
TextSettings.FontColor = claGold
TextSettings.WordWrap = False
Text = ‚Test App‘
end
[/Delphi]

and this in 10.1. Berlin

[Delphi]
object Label1: TLabel
Align = Center
AutoSize = True
StyledSettings = [Family]
Size.Width = 74.000000000000000000
Size.Height = 24.000000000000000000
Size.PlatformDefault = False
TextSettings.Font.Size = 18.000000000000000000
TextSettings.Font.StyleExt = {00070000000000000004000000}
TextSettings.FontColor = claGold
TextSettings.WordWrap = False
Text = ‚Test App‘
end

[/Delphi]

Delphi 10.x :: GetIt -> JEDI JCL Installer not working as intended

  • Installation from GetIt in Delphi 10.0
  • Installer wanted to install all 4 versions so said no to „keep installation values“
    (wrong values for advanced options)
  • But started immediately installation without letting me edit / change installation values
  • compiler crashed somewhere in the width of installation but went on after click on „Abort“ in exception dialog
  • deinstallation shows dialog for registration of HTML Help 2.0 files ??
  • another  -1 for GetIt
  • going back to manual installation