Far from what you call the "RC_DATA" Windows-specific solution, this is actually the most straightforward cross-platform way Delphi provides. What you need to do is add files to the project through Project | Resources and Images ...; since other types of resources are Windows-specific, just stick with RCDATA for each one. Then, to load, use TResourceStream , as you could do in a VCL application ( RT_RCDATA declared in System.Types ):
procedure LoadStringsFromRes(Strings: TStrings; const ResName: string); var Stream: TResourceStream; begin Stream := TResourceStream.Create(HInstance, ResName, RT_RCDATA); try Strings.LoadFromStream(Stream); finally Stream.Free; end; end;
In addition, if for some reason you want to check whether a given resource exists before loading, the System block implements the Windows API FindResource for platforms other than Windows.
An alternative to embedded resources is to use Project | Deployment for adding files to an application package (OS X and iOS) or APK (Android). Although this can be considered a more "platform-related" way, the corresponding "remote path" is platform-specific ... and, frankly, if a person is so obsessed with being platform-based, he cannot process embedded resources, then they don’t will use FMX in the first place ...
Update: in relation to the article to which the link is now attached, it shows how to write the RES file manually, which a person usually doesn’t do - if you are not using a small IDE resource manager, then the normal way is to create an RC script and compile it using the compiler Borland or Microsoft resources.
source share