Category: Firemonkey

Restrict user input to digits only with InputQuery

I've followed the Embarcadero documentation to provide an input dialog to let user give keyboard input (I followed the C++ example exactly). I know this is implemented with TEdit boxes internally, is it possible to restrict user input in the dialog to digits only (0-9)? I'm thinking something like we can do with regular TEdit boxes using the FilterChar property or somehow specify the KeyboardType property to NumberPad.
Read More

Android apps migration from Delphi 10.3.1 to 10.3.2

I have two problems after switching to 10.3.2 from 10.3.1 1) When I install the APK on the phone I get information "Google protect blocked APP.... " I have the same SDK version in 10.3.1 and 10.3.2. I get information only for APK under 10.3.2. What I should change ? 2) I can't run android projects created in 10.3.1 after compile in 10.3.2. I cleaned the library directory in my project. The application compiles, installs and then app stops on the default splash. UPDATE FOR POINT 2 - Problem solved
Read More

Inaccessible value from control on embedded child form (Delphi, Firemonkey)

I am new to Firemonkey (using RadStudio 10.3.2), and I am trying to update a listbox control on an embedded child form. However, when I try to access any of the properties of the listbox (ListBox1), they show up as "Inaccessible value." I'm pretty sure that I am missing something very simple. I appreciate any and all help! Thank you! I have made the following, simplified application, to illustrate my issue. Project1 Application Initialization: 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.Run; end. Unit1.pas: 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; type TForm1 = class(TForm) Panel1: TPanel; Button1: TButton; procedure FormCreate(Sender: TObject); procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } procedure EmbedForm(AParent:TControl; AForm:TCustomForm); end; var Form1: TForm1; implementation {$R *.fmx} uses Unit2; procedure TForm1.FormCreate(Sender: TObject); begin // Embed Scenarios Form EmbedForm(Panel1, TForm2.Create(Self)); Panel1.Visible := true; end; procedure TForm1.Button1Click(Sender: TObject); var data_strings: array of string; begin // Assign strings SetLength(data_strings, 2); data_strings[0] := 'Hello'; data_strings[1] := 'World'; // Load strings Form2.ListBox1.Items.Add(data_strings[0]); Form2.ListBox1.Items.Add(data_strings[1]); end; procedure TForm1.EmbedForm(AParent: TControl; AForm: TCustomForm); begin while AForm.ChildrenCount>0 do AForm.Children[0].Parent:=AParent; end; end. Unit2.pas: 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.Layouts, FMX.ListBox; type TForm2 = class(TForm) ListBox1: TListBox; private { Private declarations } public { Public declarations } end; var Form2: TForm2; implementation {$R *.fmx} end. The Form2.ListBox1 properties are inaccessable to the code on the main form--see the Button1Click event. I have the parent form (Unit1) using the child form (Unit2). I am at a loss as to why an enabled, visible component is inaccessible. My modal forms never had this issue, so I think it has to do with the embedded child form.
Read More

Visual Components Library (VCL): The Best Choice for Windows Applications

Atanas Popov (General Manager of Embarcadero) and Marco Cantu (RAD Studio Product Manager at Embarcadero) have had a conversation about the role of VCL for Windows client development. This is an un-edited transcript of the recording of the chat. Atanas: Hi Marco, I wanted to take this opportunity to ask you a couple of questions about VCL. As the interest in upgrading to Windows 10 grows and companies consider modernization options, people are always asking, "Well, do I go VCL? Do I go FireMonkey? Do I go Web?" While we have a lot of information on VCL, it's either too technical or it is too high level. It appears that we can't get the right balance to communicate clearly why VCL is such a great choice. So given that you are one of the foremost experts on the subject, I thought that I can ask you a few questions on VCL. To start with, can you give us your definition of VCL? Marco: VCL is, as the name implies, a Visual Component Library. It's a class library representing both in-memory objects and visual objects that you can use on your application. It is both visual and component-based, meaning you have the ability to drag and drop components in a designer and immediately preview and get a feeling of how the application is going to look like and behave. I believe that early on, it borrowed some concepts from Visual Basic, which is one of the other early tools in this space. However, differently from other tools in that space, especially at the time, it was fully object oriented. So anything you do in the designer, like creating a button, you can achieve at run time. In fact, the designer is the run time, it uses the library itself. That was very unique and powerful. While it has been replicated by some other IDEs recently, few can achieve that, especially for Windows. It remains one of the key tenets of RAD Studio, this dual nature, very easy to use and very fast for developers to create the UI and also add logical components like a database table with a query and a SQL statement, then connect it to your data grid or visual component. So everything can be done very smoothly. When the application grows, you can move most of this to the application logic to have a nicer and more robust architecture. Atanas: We've seen some similar things develop in JavaScript. It is a space where there are a lot of drag and drop options, but it seems like a lot of them have much harder time connecting the design time process with actually deployment and keeping them in sync. But in terms of Windows development, what in your mind are the alternatives and how does VCL compare to them? Marco: VCL started as a wrapper on top of the Windows API, but it is very high-level of a wrapper. It is a thick layer. It adds a lot of concepts on top of the APIs, but still most of the VCL control have a Windows handle. So, they map closely to the API and the mapping is very strict. For example, Delphi is the only language that has a keyword message that lets you map to a Windows message. By comparison, other languages in the Microsoft space use more complex code to go around and do this mapping. For us, this is a language feature, which is really unique. The only library that gets similar to what we do is WinForms for C# and.NET. However, WinForms is much smaller in terms of library scope and has fewer components. It is also .NET, which means that every time you are using a component, there is a call from.NET, a marshaling call to the native and then back, while Delphi being native, everything is compiled, everything is a direct API call, therefore faster and smoother. The layer has more complex actions and the action manager concept abstracts the UI. In WinForms this is available through third-party add-ons, but not as a native feature. Unfortunately, WinForms development stopped quite some time ago while VCL continues to have full integration with not just the Windows API, but COM and now integration with WinRT. Because these are all platform layers, they are all native, all written in C++ ultimately, but we can interface directly with Delphi. The other alternative is Visual C++, but Visual C++ is really a thin layer on top of the API. There is very little productivity advantage and it's not visual. You don't drop components. You do that only for dialogue boxes, but it's not how visualization is generally understood. Yes, it's good, you can call an API as natively as Delphi, but the library is limited and you end up having to write way more code than you do on the Delphi side. Plus C++ is a difficult codebase to maintain and upgrade. Atanas: This sound pretty clear. What about some of the new tools that are out there that come from web or mobile. For example, Electron provides nice JavaScript wrappers to build native applications. What is your opinion on that approach when it comes to building Windows apps? Marco: I can understand the desire having a single language like JavaScript that you can use on mobile and desktop. However, what we are seeing is a new set of applications that are really, really memory hogs. They consume a lot of memory and are generally quite slow. I have Windows clients for some of my chat applications or social applications and all of these are really slow. If you're just browsing messages on a social network, it should not take a gigabyte of memory. That's illogical. It cannot take minutes to boot, and it's not the connection - it's the rendering; it's the processing. A lot of them are written with Electron. They encapsulate the application like a full web server, node JS as an engine, a full browser for the rendering. And the other thing, they don't look Windows in any way. And a Windows UI is Windows UI. We should respect the environment. We will never write an iOS application that does not look iOS. Why should we write a Windows application that looks completely extraneous to the platform, completely different from the platform? I understand the advantage of using a single language, but in terms of performance, quality, I am not sure that the efficiency is worth it. Another thing, the code is JavaScript, so reverse engineering and analyzing the code is more cumbersome than Delphi. Because you're relying on many more third-party components, you need to keep updating those components. You have dependencies, you have dependencies that have potential security holes, like a browser and a web server. So you need to keep continuously updating all of these modules in your system. More dependencies means less control, like recently we learned that Apple iOS has been rejecting application because the user under-commented APIs. Using a lot of open source, also presents risks. There are some advantages of course. JavaScript is a common language with many developers, but quality, performance, stability, platform integration, these are all weaknesses compared to building a native application with Delphi or C++ or another direct language. Atanas: I think Microsoft has done a really nice job with Windows 10, and if you look at just the look and feel on the platform, it is so modern and the applications are powerful and fast. So, for the same reason that people build native application for iOS or Android, I see no reason not doing this for Microsoft. You have a much bigger screen with a lot more UX options, so you really should take full advantage of the OS. Marco: And the other important thing to note is that, 10 years back, doing native felt you're at risk. Microsoft just kept saying, "Oh, eventually, there will be.NET only running on Windows." And so a lot of our customers were scared, saying, "Oh, what's happening here? Because in the future, I won't be able to run my application." That didn't happen. Five years ago there was another scare, "Oh, you need to move to Universal Windows Platform, because if it's not Universal Windows Platform (UWP), it's not going to run on Windows." All of our customers got worried. Then, we had the desktop bridge, and we were able to support the Universal Windows Platform seamlessly through Centennial. Your VCL application can be easily deployed to the Windows store. Today Microsoft has completely reversed the position. UWP doesn't really exist anymore, and the new platform component on Windows are native. So the new Edge control for embedding the Edge Chromium web browser is a native control. The new WinUI version 3 has a bunch of native controls. So Microsoft is kind of giving up on trying to push everybody on UWP and say, "Okay, go native," and then for protection and security, they are going to use MSIX, which is a technology that's very friendly to the native compiled application. So, that's great for us because it provides even more APIs we can embed, encapsulate and support from the Delphi and C++ VCL applications. Atanas: I do think that Microsoft with Surface strategy and other moves, have done well to energize the Windows platform in general. So they are more confident in that path, which is excellent for us, excellent for Microsoft. Any last comments related to building a Windows application today -- or any other advice for customers? Marco: There are few things that are important. First is start considering today's hardware and architecture and not yesterday's. Start to build applications that really have the Windows 10 UI, and not the Windows XP UI or something like that. Using styling is relevant. If you use styling, it is a little extra effort, but using styles allows you to have an application that feels native, and you have the flexibility of adapting to whatever is native like today or tomorrow or the day after tomorrow, without having to rewrite anything in your code. So the fact that the application can look Windows 7 or Windows 10 just by changing a flag, provides a lot of additional value because there's no rewrite. If you consider Microsoft, they're saying, "If you want to embrace the new modern UI, rewrite your UI from scratch." And honestly, it's difficult for a company that invested years in building the UI to rewrite. We say, "No, just apply a level of styles on top of UI. It will still become a very nice application. There is some work, it's not completely free, but it's a small percentage of your development effort. And we are focused on making sure that styles work perfectly on all scenarios. There's still some hiccups on 4K monitors, but that is one of the areas we are focused on fixing. For example, we now have support for having images in your application that have multiple DPIs, so you can have high-quality crisp image even on a 4K monitor. There aren't many other Windows UI libraries that offer this capability. In most other windows UI libraries, you're on your own in terms of supporting a high DPI monitor. There's no ready-to-use components. So it's important to start thinking about 4K monitors from the beginning, start thinking about styles, and start thinking about UI. "Okay, I shouldn't use a check box, I should use a modern component replacing it via a toggle because that's the modern look and feel and the modern style." The good news is that all of these things are parts of VCL, so you don't really need to do much extra effort rather than rethink your UI a bit, learn about these new components that we provide, and embrace them. Atanas: Very cool. Well, thank you, Marco. This is much appreciated. We need to do a lot more to communicate what VCL is all about. There are so many wonderful VCL case studies out there. However, our customers are busy, they don't always share those, so the more we explain, the more our customers will be confident in building new powerful apps incorporating these features. Marco: Sure. I want to say that Delphi and VCL are the only true visual development options dedicated to Windows today. And that commitment has been true for many years. You can take a 24 years old Delphi application, rebuild it and within a relatively limited effort make it a first class Windows 10 citizen. The other options, like Visual Basic (and maybe Visual FoxPro) have come and are gone. Your investment in VCL is still here today, and it's going to be there in the future.
Read More

Open PDF file Delphi RIO

I would like to open a PDF that is allocated locally in my application (ANDROID only), but I am not getting it at all.

I already tried this link: Getting exception while opening PDF file for Android 26 using Firemonkey/Delphi but not work in Delphi RIO.

So I kept looking and got this code:

procedure TF_NovaART.PRO_MapeaClick(Sender: TObject);
var
  fName       : String;
  LIntent: JIntent;
  LAuthority: JString;
  LUri: Jnet_Uri;
begin
    fName := TPath.GetDocumentsPath + PathDelim + 'PRO_Topo.pdf';

    {$IFDEF ANDROID}
      LAuthority := StringToJString(JStringToString(TAndroidHelper.Context.getApplicationContext.getPackageName) + '.fileprovider');
      LUri := TJFileProvider.JavaClass.getUriForFile(TAndroidHelper.Context, LAuthority, TJFile.JavaClass.init(StringToJString(fName)));
      LIntent := TJIntent.JavaClass.init(TJIntent.JavaClass.ACTION_VIEW);
      LIntent.setDataAndType(LUri, StringToJString('application/pdf'));
      LIntent.setFlags(TJIntent.JavaClass.FLAG_GRANT_READ_URI_PERMISSION);
      TAndroidHelper.Activity.startActivity(LIntent);

    {$ENDIF}

end;

Which was found on this link: Getting exception while opening PDF file for Android 26 using Firemonkey/Delphi

I did exactly as it is written, but returns me the following error:

java;lang;NullPointerException: Attempt to invoke virtual method
‘android.content.res.XmlResourceParser android.content.pm.Package
ItemInfo.loadXmlMetaData(android.content.pm.PackageManager,
java.lang;String)’ on a null object reference

now it’s giving :

java.kabg.illegalArgumentExcpetion: Failed to find configurated root
that contains
/data/data/com.embarcadero.ART_Dinamica/files/PRO_Topo.pdf.

PS: I put my pdf (PRO_Topo.pdf) in the deployment and the remote patch is “.\assets\internal”

I think I need to put in the “AndroidManifest”, but I’ve already researched it and I’m not sure how to set it. (This bug has been stalking me for over a month. I skipped this part of the code to do other things, but again I’m unable to continue because of it)

The GIT link I got from the File Provider drive is this: https://github.com/DelphiWorlds/KastriFree/blob/master/API/DW.Androidapi.JNI.FileProvider.pas

If anyone can help me I will be sooo grateful.

Below I will leave my AndroidManifest.template.xml

<?xml version="1.0" encoding="utf-8"?>
<!-- BEGIN_INCLUDE(manifest) -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
        package="%package%"
        android:versionCode="%versionCode%"
        android:versionName="%versionName%"
        android:installLocation="%installLocation%">

    <uses-sdk android:minSdkVersion="%minSdkVersion%"        
    android:targetSdkVersion="%targetSdkVersion%" />
    <%uses-permission%>
    <uses-feature android:glEsVersion="0x00020000" android:required="True"/>
    <application android:persistent="%persistent%" 
        android:restoreAnyVersion="%restoreAnyVersion%" 
        android:label="%label%" 
        android:debuggable="%debuggable%" 
        android:largeHeap="%largeHeap%"
        android:icon="%icon%"
        android:theme="%theme%"
        android:hardwareAccelerated="%hardwareAccelerated%"
        android:resizeableActivity="false">

        <%provider%>
        <%application-meta-data%>
        <%services%>
        <!-- Our activity is a subclass of the built-in NativeActivity framework class.
             This will take care of integrating with our NDK code. -->
        <activity android:name="com.embarcadero.firemonkey.FMXNativeActivity"
                android:label="%activityLabel%"
                android:configChanges="orientation|keyboard|keyboardHidden|screenSize"
                android:launchMode="singleTask">
            <!-- Tell NativeActivity the name of our .so -->
            <meta-data android:name="android.app.lib_name"
                android:value="%libNameValue%" />
            <intent-filter>  
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter> 
        </activity>
        <%activity%>
        <%receivers%>
    </application>
</manifest>
<!-- END_INCLUDE(manifest) -->

Now my AndroidManifest is:

<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="26" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

<uses-feature android:glEsVersion="0x00020000" android:required="True"/>
<application android:persistent="False" 
    android:restoreAnyVersion="False" 
    android:label="ART_Dinamica" 
    android:debuggable="True" 
    android:largeHeap="False"
    android:icon="@drawable/ic_launcher"
    android:theme="@style/AppTheme"
    android:hardwareAccelerated="true"
    android:resizeableActivity="false">

    <provider
        android:name="android.support.v4.content.FileProvider"
        android:authorities="com.embarcadero.ART_Dinamica.fileprovider"
        android:exported="false"
        android:grantUriPermissions="true">
        <meta-data android:name="android.support.FILE_PROVIDER_PATHS"

android:resource=”@xml/provider_paths”/>

    <!-- Our activity is a subclass of the built-in NativeActivity framework class.
         This will take care of integrating with our NDK code. -->
    <activity android:name="com.embarcadero.firemonkey.FMXNativeActivity"
            android:label="ART_Dinamica"
            android:configChanges="orientation|keyboard|keyboardHidden|screenSize"
            android:launchMode="singleTask">
        <!-- Tell NativeActivity the name of our .so -->
        <meta-data android:name="android.app.lib_name"
            android:value="ART_Dinamica" />
        <intent-filter>  
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter> 
    </activity>

    <receiver android:name="com.embarcadero.rtl.notifications.NotificationAlarm" />

</application> </manifest> <!-- END_INCLUDE(manifest) -->

My provider_paths.xml:

<?xml version="1.0" encoding="utf-8"?>
<paths xmlns:android="http://schemas.android.com/apk/res/android">
  <external-path name="external_files" path="."/>
</paths>

Deployment image

Read More

Read More

Implementing IInterface works in VCL but not in FMX

I have this interface called "IViewFrame" its implementation is like this: __interface INTERFACE_UUID("{D307ACE9-FE13-4F11-BEEB-A15C908579BC}") IViewFrame : public System::IInterface { //--------------------------------------------------------------------------- protected: //Setters/Getters virtual void __fastcall SetView(TView *Value) = 0; virtual TView* __fastcall GetView() = 0; //--------------------------------------------------------------------------- public: //Fields/Properties __property TView *View = {read = GetView, write = SetView}; //--------------------------------------------------------------------------- }; //--------------------------------------------------------------------------- typedef System::DelphiInterface<IViewFrame> _di_IViewFrame; Now on VCL this interface is working fine here is the code: class TVCLFrame : public TFrame, IViewFrame { __published: // IDE-managed Components private: //Fields TView *FView; //--------------------------------------------------------------------------- protected: //Setters/Getters virtual void __fastcall SetView(TView *Value); virtual TView* __fastcall GetView(); public: // User declarations __fastcall TVCLFrame(TComponent* Owner); INTFOBJECT_IMPL_IUNKNOWN(TFrame); }; //--------------------------------------------------------------------------- But when I do the same thing in an FMX Frame, I get a conflict error in INTFOBJECT_IMPL_IUNKNOWN: class TFmxFrame : public TFrame, IViewFrame { __published: // IDE-managed Components TBindingsList *BindingsList; TBindSourceDB *BindSourceDB; TBindNavigator *BindNavigator1; private: // User declarations TView *FView; protected: //Setters/Getters virtual void __fastcall SetView(TView *Value); virtual TView* __fastcall GetView(); public: // User declarations __fastcall TFmxFrame(TComponent* Owner); INTFOBJECT_IMPL_IUNKNOWN(TFrame); // I get the error here }; //--------------------------------------------------------------------------- [bcc32 Error] FmxFrameU.h(50): E2113 Virtual function '__stdcall TFmxFrame::Release()' conflicts with base class 'TFmxObject' Now I looked into TfmxObjct code and found out that there is another method called Release() that conflicts with the one from the IUnknown Interface. How can I fix this issue? I want this interface to work for both VCL and FMX without any troubles.
Read More

what is wrong with this use of goto?

I'm using a goto statement to skip a piece of code (as per documentation), just for testing purposes while I debug a block of code. I'm getting an error 1526, "goto into protected scope". This is totally trivial I know, but I want to know what is wrong with how I'm using the goto code: #if defined(_PLAT_ANDROID) _di_JIntent MyIntent; MyIntent = TJIntent::JavaClass->init(TJIntent::JavaClass->ACTION_VIEW, TJnet_Uri::JavaClass->parse(StringToJString("http://relayman.org/papers/2009_FDA_paper.pdf"))); TAndroidHelper::Activity->startActivity(MyIntent); goto Skipit; Androidapi::Jni::Graphicscontentviewtext::_di_JIntent intent = TJIntent::Create(); intent->setDataAndType(StringToJString("file://" + System::Ioutils::TPath::Combine(System::Ioutils::TPath::GetSharedDownloadsPath(), "sample.pdf")), StringToJString(L"application/pdf")); intent->setAction(TJIntent::JavaClass->ACTION_VIEW); intent->setFlags(TJIntent::JavaClass->FLAG_GRANT_READ_URI_PERMISSION); if (SharedActivity()->getPackageManager()->queryIntentActivities(intent, TJPackageManager::JavaClass->MATCH_DEFAULT_ONLY)->size() > 0) { SharedActivity()->startActivity(intent); } else { ShowMessage("PDF viewer not found"); } Skipit: #endif I'm working in 10.3.2 and building toward Android target.
Read More

Delphi Firemonkey Tmediaplayer Plays only sound no video (.mkv file) Windows and Android | Windows after installing codec

I am trying to play video files, using TMediaPlayer, (non standard supported formats) in this case started with ".mkv". First tried without installing any codec (Windows 10), I knew I should get error(s), but this way I possibly could figure out how tmediaplayer works with media files. Second,on Windows, I downloaded and installed the "CCCP (Combined Community Codec Pack)", from mkvcodec.com. When run project in this case, no errors, hearing sound of the video(movie) but no Vidoe is shown. When I run my project and start playing, a program named "lav splitter" starts and is shown on trayicon, which is installed by installing the codec. This does not happen while play the same video with WMPlayer, WMPlayer is playing the video. So far for windows, I have compiled the project for android and started the app on a tablet with android 4.4.4 . I did not install any codecs, maybe together with any other app in the past, or this format is supported on android, not sure. The same problem exists on android, I can hear the sound of the video, but no video is shown. procedure TForm1.CornerButton1Click(Sender: TObject); var mediafile:string; begin {$IFDEF ANDROID} mediafile := 'storage/extSdCard/yuzuklerin efendisi.mkv'; {$ENDIF} {$IFDEF MSWINDOWS} mediafile := 'F:\yuzuklerin efendisi.mkv'; {$ENDIF} MediaPlayer1.FileName := mediafile; MediaPlayer1.Play; end; -----Edit--- The problem is solved for windows by starting a new project with the same components, mediaplayer, mediaplayercontrol and button. Probably some changes in the coding somewhere caused this. Android problem is still remaining. On android, it's able to play Mp4 video, but when playing mkv video, only audio is playing. meanwhile tried on a 10inch tablet android 4.4.4 and mobile phone android 8.1.0. Both playing only audio (.mkv) I have placed TMediaplayer, TMediaplayerControl and a button. Any Ideas why this behavior and how to fix. -------------------------------Edit2------------------------------------------------- Probably I might get downvoted for this, I was thinking of deleting the post but changed my mind, the following info can be interesting; Downloading and installing/registering "LAVFilters-0.74.1" for windows from GitHub, allows the mediaplayer play (almost) any media (tested on Windows 10). Something I did not expect but tried to play is livestream..., even this was possible... It seems to that the livestream is also being handled by lavfilters(codec). About Android, still need extra info about how to get media files/streams played using mediaplayer component. It seems to that I need a codec to get it working but I don't know how/where to get and install yet.
Read More

Single Instance of app while handling params?

I want my app to have only one instance and handle params of newly fired one. I want to use params and do some processing based on those params. I've tried David Heffernan's answer in related question but I didn't find anything related to TCreateParams in FMX and in the Delphi Rio documentation. Can't comment there as I don't have reputation though. program StartupProject; uses SysUtils, Messages, Windows, Forms, Form3 in 'firetest.pas' {MainForm}; {$R *.res} procedure Main; var i: Integer; Arg: string; Window: HWND; CopyDataStruct: TCopyDataStruct; begin Window := FindWindow(SWindowClassName, nil); if Window=0 then begin Application.Initialize; Application.MainFormOnTaskbar := True; Application.CreateForm(TMainForm, MainForm); Application.Run; end else begin FillChar(CopyDataStruct, Sizeof(CopyDataStruct), 0); for i := 1 to ParamCount do begin Arg := ParamStr(i); CopyDataStruct.cbData := (Length(Arg)+1)*SizeOf(Char); CopyDataStruct.lpData := PChar(Arg); SendMessage(Window, WM_COPYDATA, 0, NativeInt(@CopyDataStruct)); end; SetForegroundWindow(Window); end; end; begin Main; end.   unit fireTest; interface uses ... type TForm3 = class(TForm) procedure FormCreate(Sender: TObject); public procedure ProcessArgument(const Arg: string); { Public declarations } protected procedure WMCopyData(var Message: TWMCopyData); message WM_COPYDATA; var Form3: TForm3; implementation {$R *.dfm} { TMainForm } procedure TForm3.FormCreate(Sender: TObject); var i: Integer; begin for i := 1 to ParamCount do begin ProcessArgument(ParamStr(i)); end; end; procedure TForm3.ProcessArgument(const Arg: string); begin Memo1.Lines.Add(arg); end; procedure TForm3.WMCopyData(var Message: TWMCopyData); var Arg: string; begin SetString(Arg, PChar(Message.CopyDataStruct.lpData), (Message.CopyDataStruct.cbData div SizeOf(Char))-1); ProcessArgument(Arg); //Application.Restore; //Application.BringToFront; end; end.
Read More

InterBase 2020 Released

I just wrote a blog post on Embarcadero community site to announce the release of InterBase 2020: https://community.idera.com/developer-tools/b/blog/posts/interbase-2020-released-by-embarcadero Main feature is the addition of tablespaces, which allow you to customize the mapping of tables and indexes in different files, possibly on different file systems. There is also support for macOS 64 and Android 64 as part of the embedded versions (IBLite and IBToGo). InterBase is a really unique and very poweful database engine, and one worth considering for mobile, desktop, and servers alike. For more info, see the InterBase product page at: https://www.embarcadero.com/products/interbase
Read More

FireMonkeyでのマルチデバイスデザイン – CodeRage シリーズ

今週のCodeRage 2019では、FireMonkeyでのマルチデバイスデザインシリーズに関する素晴らしい内容を紹介しています! 今年、提供形式を変更した目的の1つは、45分の完全なビデオを作成する時間がとれない場合でも、より多くの方々に参加していただくことでした。(read more)
Read More