Download the official CameraDemo sample. It captures a photo and saves it to disk.
Request runtime permissions for the camera (crucial for modern Android and iOS compliance).
Delphi FireMonkey (FMX) is a powerful cross-platform GUI framework designed for creating high-performance applications across Windows, macOS, iOS, Android, and Linux. Unlike the Visual Component Library (VCL), which relies on Windows-specific controls, FMX utilizes a hardware-accelerated 3D and 2D graphics engine to render user interfaces consistently across all operating systems.
$IFDEF ANDROID PermissionsService.RequestPermissions(['android.permission.CAMERA']); $ENDIF
Never use absolute paths like C:\data.json in cross-platform samples. Replace with TPath.Combine(TPath.GetDocumentsPath, 'data.json') (requires System.IOUtils ).
Replace these with your own service interfaces or use the IFMXPlatformServices pattern.
Look for the "FMX.ControlsDemo" to see how TLayout , TGridPanelLayout , and TScrollBox interact. 2. Camera and Image Processing
Learn how to programmatically invoke the system camera, switch between front and rear lenses, take high-resolution photos, and save them directly to the local device database.
Getting started is straightforward:
: Excellent samples for game developers or fitness app creators, showing how to read 3D spatial data as the user tilts or shakes their device. Best Practices Learned from FMX Samples
Modern versions of RAD Studio feature a "Getit Package Manager" and a "Try a Sample Project" link directly on the startup screen.
begin Application.Initialize; Application.CreateForm(TForm1, Form1); Form1.MapView1.MapType := TMapType.Normal; Application.Run; end.
: Demonstrates how to access front/back cameras, adjust resolutions, and manage the camera torch.
Also, explore – a separate library that replaces FMX's default canvas with Skia (Google's 2D graphics library). The Skia samples are excellent for custom UI rendering.
Widely known for providing deep-level mobile extensions and advanced user interface tricks for iOS and Android. Best Practices When Implementing FMX Sample Code