Tag: firemonkey

Embarcadero C++Builder Android Application SEGV_MAPERR Crash on Specific Phones (Galaxy A51)

I have a completed Android application compiled with Embarcadero C++Builder (FMX) that works on all the phones I have in my possession (Huawei P30, Samsung Galaxy A5, Samsung Galaxy S8). I recently sent it to some friends and it works on almost all of their phones. Two people in particular have a Samsung Galaxy A51 and the app always crashes immediately when trying to start it, before executing any of my code at all. App is in release mode, application store, certificates configured, etc. I even created a blank application with a single button as a test and they encounter the exact same crash, so I know it has nothing to do with my app specifically. Android crash logs give the following error on both phones: Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 in tid 23831 (appname), pid 23831 (appname) Further, I got them to use SysCheck and all hardware looks OK (NEON, etc.) The backtrace starts with /apex/com.android.runtime/lib/bionic/libc.so (__libc_init+66), goes into a bunch of art:: calls in /apex/com.android.art/lib/libart.so, and throws an error at /system/lib/libandroid_runtime.so (android::loadNativeCode_native(...)). I can post the rest of the backtrace if needed. Any ideas what could be causing this? This seems like a critical flaw in the C++Builder development for Android if certain Android phones simply can't run any published applications.
Read More

How to open the default app on a mobile device based on the file extension?

We are writing a cross platform application in Firemonkey. One of the features is that the user can download files that are stored on the server. Therefore we have a REST service the application uses to download the file. We don't know the file type, it could be pdf, image or a word document, ... I'm looking for a routine that allows launching the standard app on the mobile device that is capable of opening the document and this for IOS and Android. Can anybody help me with that? Thx, Dominique
Read More

TMS WEB Core v1.8 Sirolo released

TMS WEB Core v1.8 Sirolo is released!

We are excited to inform that TMS WEB Core v1.8 Sirolo is released today. This new version is the result of months of hard work of the team to bring several new milestones. Take advantage of the summer-time to expand your horizons and dive into the wonderful web world for Object Pascal developers. 
Here is a brief overview of the core new features included in TMS WEB Core v1.8 

1) Miletus support for macOS and Linux

After Miletus targeted Windows in TMS WEB Core v1.7, our team now accomplished the phenomenal next step to create cross-platform web technology based desktop applications for Windows, macOS and Linux. And all that with a minimal footprint. On Windows and Linux this means single executable file apps and for macOS the typical application folder but also here with a single application executable file. Deployment can be done via ultra simple XCOPY deployment.
In a nutshell, you can create desktop applications from a single source code base from your Delphi IDE on Windows. You do actually not need an Apple mac machine or Linux box to create these applications. The GUI of these applications is rendered in the browser and therefore empowered by HTML5 and CSS3. You can take advantage of existing web application templates to create stunning GUIs
Not familiar with Miletus? You can learn all about it from this webinar replay

2) New Miletus Interbase and Firebird local database support

In this new version, we added two more possible local databases that can be directly used from a Miletus application and that is Interbase and Firebird. No need here to create a REST API interface, you can directly connect a client dataset to local databases. In v1.8 this is now: MS Access, MS SQL, mySQL, SQLite, Interbase and Firebird. 
            

3) Miletus support to access INI files, registry, OS version info

Convenient for storing application settings, INI files or registry is what developers frequently use. So, from a Miletus app you can now easily access these INI files and the registry in the same way as you can from a VCL or Firemonkey application. Of course, there is no registry on macOS or Linux and here there is automatic fallback on INI files. In addition, a new API is added to retrieve operating system version information about the operating system where the Miletus executable is running.

4) Two new UI components: chatbox + rating control

We have added two new controls to TMS WEB Core v1.8. This is a chatbox control and a rating panel. With the TWebChatbox control, you can write web chat applications with little to no code. Drop this component on the form and all you need to do is write some lines of code to send the message to your chat server of choice or receive messages from there. The other new component is the TWebRatingPanel. This is the classic UI pattern of rating via clicking a number of stars (or other icons of choice). The rating panel offers setting rates in units of 1, 0.5 or fully fractional.

5) SHA1 hashing support in the TWebCrypto component

As SHA1 is still from time to time needed in specific communication protocols, we extended the TWebCrypto component that is internally using the browser crypto API to also offer SHA1 support.

6) TWebLocalStorage, TWebSessionStorage components

Previously available as classes, this is now more convenient to use as non-visual components with the new OnChange event exposed to let your app become aware when other instances have changed the local or session storage.

7) Grid enhancements

TWebStringGrid, TWebDBGrid have been improved and new properties to set selection color, selection text color, grid line color, border color have been added. A new event OnClickCell was also added.

8) Various smaller new features

Now it is easier to load a TFrame also dynamically at runtime with the new CreateNew() constructor. The TWebMemo has a SpellCheck property to control whether the browser should use its integrated spell check on the memo content or not.  The TWebClientConnection that bridges a TWebClientDataSet to a server offers settings for using custom HTTP(s) commands as well as set PostData for the HTTP(s) POST request. The TStringList got a promise based LoadFromFileAsync() method to use file loading in combination with await(). For the TBitmap, there is now access to the opacity value per pixel…

Availability

TMS WEB Core v1.8 Sirolo release is now available to all TMS WEB Core or TMS ALL-ACCESS users with an active license. Download the new version after login on our website or via the TMS Subscription Manager. If you had a prior version installed, perform an uninstall first and then install the new v1.8. We didn’t do breaking changes to APIs or class interfaces, so your existing apps should continue to run fine with the new version.

What’s next

The next step is bringing TMS WEB Core for Visual Studio Code on par with its Delphi companion by also integrating Miletus support. You can expect a beta for TMS WEB Core for Visual Studio Code very soon. At the same time, our team is already heavily researching key v1.9 new features, some of which are ground-breaking. We aim to bring some more hot news about it this summer!

Learn & get started

Holidays are a good period to learn and get your feet wet with TMS WEB Core. There are plenty of resources to get started:

1) TMS WEB Core book from colleague, expert and evangelist Holger Flick:

2) Webinar replays about TMS WEB Core you can find on our TMS Web Academy (fully developed with TMS WEB Core by the way)
3) TMS WEB Core training course offered by our colleague Wagner R. Landgraf 
4) Over 100 sample projects included in the product (see in C:\Users\USERNAME\AppData\Local\tmssoftware\TMS WEB Core\Demo folder)
5) Over 100 blog posts about TMS WEB Core 
6) Tons of instructional videos we created
7) Consult with our partners

Share

We create TMS WEB Core with love for you so we love to hear your feedback, your comments, your inputs, your ideas. Tell us about your experiences, tell us what we can do better, what new features you wish, let fellow Delphi developers see what exciting projects you created with TMS WEB Core! Our team is listening.

Read More

Read More

New Delphi Community Edition 10.4 Available

As announced yesterday with the blog post Delphi & C++Builder FREE Community Editions Updated to Version 10.4.2 Are Now Available, Embarcadero has moved the free CE license of its two IDEs, Delphi and C++Builder, to the last version of the product, 10.4 Sydney. The Community Edition is a free edition for non-professional developers (read the FAQ or the EULA for more information) and anyone who wants to start using one of the 2 products to learn them. Being a complete product aligned to the Professional Edition of Delphi or C++Builder, it allows building applications for desktop (Windows and also macOS for Delphi) and mobile (Android and iOS). The CE edition includes both the VCL and the FMX UI libraries, but also the core RTL and database libraries, web technologies and more. If you are interested, you can download 10.4 CE and also sign up for the "summer camp" to learn more about the technology of these CE editions and other Embarcadero tools: Download Delphi CE Download C++Builder CE Signup for the summer camp I've very happy we are making the 10.4 version of Delphi and C++Builder available as a free Community Edition tools, as I'm certain a lot of people will leverage the opportunity to learn about our technology, both in terms of programming languages and libraries. If you are new to it, Delphi is a lot of fun to learn and a very powerful natively compiled language, worth having a deep look.
Read More

doc, xls and other files. How open file for edit and save on Android

Firemonkey 10.4 I have files at app internal memmory. i Open it like this LFile := TJFile.JavaClass.init(StringToJString(AFileName)); Intent := TJIntent.JavaClass.init(TJIntent.JavaClass.ACTION_VIEW); Intent.setDataAndType(TAndroidHelper.JFileToJURI(LFile), ExtToMime); Intent.setFlags(TJIntent.JavaClass.FLAG_GRANT_READ_URI_PERMISSION); Intent.addFlags(TJIntent.JavaClass.FLAG_GRANT_WRITE_URI_PERMISSION); TAndroidHelper.Activity.startActivity(Intent); I can open and save (overwrite) simple txt file by simple text editor on Android, but can not do it for doc, docx. I have tried official office and wps. But I am always offered to save to the general memory of the phone, and never offered to re-save the file to its original location. What I want to get: the user opens the doc file for editing he makes changes and saves the user returns to my application p.s. Sorry. some wrong with editor and code formating.
Read More

How to add custom properties to dynamically (programmatically) created controls in FireMonkey?

In the app that I am building I am adding controls dynamically to TFramedScrollbox control on Form. Here is the code that I am using: pnlNew: TFlowLayout; pnlNew := TFlowLayout.Create(sbMain); pnlNew.Align := TAlignLayout.Top; pnlNew.ClipChildren := True; pnlNew.Parent := sbMain; And this code is working as expected. But I want to add dynamic properties like OrgHeight, CreateOrder, PrevControl, etc. to this programmatically created control. How to do this? TIA
Read More

Why does TFramedScrollBox always return number of controls as 2 only in FMX?

I have to know number of controls placed inside a TFramedScrollBox control container. When I use the code TFramedScrollBox.ControlsCount. It always return the value 2. Why? I want to use the for loop and iterate through each control and set a few properties. As the number of controls returned is always 2 I am not able to iterate through each control contained inside TFramedScrollBox. How to solve this problem?
Read More

Scroll bars on a Delphi FMX tComboBox.ListBox not showing on a Mac

I’m using Delphi 10.4.2 and trying to make the vertical scroll bar on the listbox of an FMX tCombox show all the time. It works fine on a PC but on a Mac the scrollbar disappears unless you’re actively scrolling the mouse wheel. If I put a regular tListbox on the form, I can make the vertical scroll bar appear constantly with the line ListBox1.AniCalculations.AutoShowing:=false; but I can’t seem to do the same for a tComboBox.Listbox. Nothing I can think of to try has any affect on the tCombox.ListBox. There must be some way to make the scroll bar stay; what am I missing?
Read More

Firemonkey, Dark theme

The Web Browser component uses the operating system theme by default (Dark or light). How to disable the use of the dark theme? Or how to properly support both themes in my application? As I understand, it is not supported by all components by default. Do you have a link to some article on how to do it correctly?
Read More

FMX: How to create a ToolWindow form that cannot be maximised?

I have a form in my application which is triggered with ShowModal. I have set the BorderStyle to ToolWindow because I don't want it to be resizable. However, I discovered that it can still be maximised by double clicking the title bar. I don't want that. To prevent this I tried setting biMaximize to False in BorderIcons. This seems to work when I run the application from the IDE - it can no longer be maximised by double clicking the title bar. However, when I run the application directly from the compiled executable, that form always appears the wrong size (much too high)! WindowState is set to wsNormal. My application is built for Windows and I'm running on Windows 10. How can I create a form that cannot be resized and why is it behaving differently when run outside the IDE? Edit: I've discovered that this is related to the Windows display settings with multiple monitors. My screen scale is set to 125% on one monitor and 100% on the other. If I set both to 100% then the form appears the right size. If I turn off one monitor then it also appears correctly. My main question is, how can I prevent a double click of the title bar maximising the form without setting biMaximize to false? See the following example. To reproduce the error you will need two monitors. Set one to 100% scale and the other to 125% in Display Settings. Then build the app for Windows and run the exe from outside the IDE. Click the button to show the second form and it appears much too large. I'd appreciate if anyone could confirm that they get the error and also if it still occurs in the latest version of 10.4. If so then I will report it. Project: program Project1; uses System.StartUpCopy, FMX.Forms, Unit1 in 'Unit1.pas' {Form1}, Unit2 in 'Unit2.pas' {Form2}; {$R *.res} begin Application.Initialize; Application.CreateForm(TForm1, Form1); Application.CreateForm(TForm2, Form2); Application.Run; end. Main Form and Unit: object Form1: TForm1 Left = 0 Top = 0 Caption = 'Form1' ClientHeight = 480 ClientWidth = 640 Position = ScreenCenter FormFactor.Width = 320 FormFactor.Height = 480 FormFactor.Devices = [Desktop] DesignerMasterStyle = 0 object Button1: TButton Position.X = 256.000000000000000000 Position.Y = 168.000000000000000000 Size.Width = 137.000000000000000000 Size.Height = 22.000000000000000000 Size.PlatformDefault = False Text = 'Show ToolWindow' OnClick = Button1Click end end . unit Unit1; interface uses 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, Unit2; type TForm1 = class(TForm) Button1: TButton; procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.fmx} procedure TForm1.Button1Click(Sender: TObject); begin Form2.ShowModal; end; end. Second Form and Unit: object Form2: TForm2 Left = 0 Top = 0 BorderIcons = [biSystemMenu, biMinimize] BorderStyle = ToolWindow Caption = 'Form2' ClientHeight = 237 ClientWidth = 344 Position = ScreenCenter FormFactor.Width = 320 FormFactor.Height = 480 FormFactor.Devices = [Desktop] DesignerMasterStyle = 0 object Button1: TButton ModalResult = 8 Position.X = 136.000000000000000000 Position.Y = 208.000000000000000000 Text = 'Close' end end . unit Unit2; interface uses 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; type TForm2 = class(TForm) Button1: TButton; private { Private declarations } public { Public declarations } end; var Form2: TForm2; implementation {$R *.fmx} end.
Read More

How to clone a TPanel in Delphi FMX application?

I am building a application using FMX. This app will run on Windows, Mac OSX, and Linux. I have a need to clone a TPanel which is contained in another TPanel. Clone function provided in FMX is throwing an error: Class TForm1 not found. How to clone a TPanel in an FMX app? Here is the code I am using: procedure TForm1.Button1Click(Sender: TObject); var CurrentControl, ClonedControl: TFMXObject; CtlrNameCnt: String; begin CtlrNameCnt := IntToStr(Panel1.ControlsCount); CurrentControl := Panel1; ClonedControl := Clone(CurrentControl); //<- this gives error ClonedControl.name := CurrentControl.name + '_' + CtlrNameCnt; ClonedControl.Parent := Panel1; end;
Read More

FMX 3D and fopen() function

New to C++ Builder 10.4. Migrating from XE4. A line of code fopen() that works fine in the old environment InputFileHandle = fopen(FileName, "rb"); does not return a valid pointer in the FMX 3D environment for a file in the same directory that the project is running. I'd appreciate if you can give me a solution for that.
Read More