Get access to over 100 FireMonkey cross platform samples for Android, IOS, OSX, Windows, and Linux!

AndroidAppmethodCode SnippetDelphiFiremonkey

Tutorial To Read And Write Bar Codes And QR Codes With Delphi XE5 Firemonkey On Android

Delphi XE5 Firemonkey Barcode Read Write TutorialAndrea Magni has a blog post up with a tutorial for reading and writing bar codes and QR codes on Android with Delphi XE5 Firemonkey. There are a number of different blog posts and components around for handling bar codes and QR codes on Android. This tutorial explains how to use the third party application Barcode Scanner (which is free from Google Play) to handle reading and writing the bar codes. This method is similar to using CameraUI (aka the built in camera application on the device) for taking photos and videos. Even if you don’t need bar code scanning functionality the tutorial shows you how to launch an Intent on Android and then wait for the result to come back. The blog post is in Italian but I’ve run it through  Google Translate for you. Here is some sample code from the tutorial which shows how to setup an ApplicationEventHandler which will receive the results from the Intent:
procedures TForm1 . FormCreate (Sender: TObject);
begin
FWaitingForResults: = False ;

if not TPlatformServices . Current . SupportsPlatformService (IFMXClipboardService, IInterfaces (FClipBoardService)) then
raise Exception . Create ( 'Can not get access to clipboard service!' );

if not TPlatformServices . Current . SupportsPlatformService (IFMXApplicationEventService, IInterfaces (FApplicationEventService)) then
raise Exception . Create ( 'Can not get application event service' );
FApplicationEventService . SetApplicationEventHandler (ApplicationEventHandler);
end ;

Head over and check out the full tutorial on reading and writing bar codes and QR codes on Android.

Have Delphi Firemonkey questions? Ask and get answers on StackOverflow.

Related posts
AndroidComponentDelphiDemoFiremonkeyIOSLinuxOSXShowcaseWindows

Experience ChatGPT As A Native Cross-Platform Firemonkey Application

DelphiLibraryWindows

Run Large Language Models Entirely On The GPU With Delphi And Vulkan

Code SnippetDelphiDemoLibraryWindows

Add Real-Time AI Voice Conversations To Windows Applications

ComponentDelphiDemoLibraryWindows

Give AI Models Eyes, Ears, And Real-World Capabilities

Sign up for our Newsletter and
stay informed
[mailpoet_form id="1"]

Leave a Reply