function TMainForm.CheckBarcode :boolean;
var
list : TStringList;
begin
Result := true;
{$IFDEF Android}
if BarcodeChecked then exit;
list := TAndroidHelperClass.getListOfApplications();
if list = nil then exit;
try
if not (list.Text.Contains('com.google.zxing.client.android')) then begin
Result := false;
MessageDlg('This application requires a QR code scanner application.'), TMsgDlgType.mtCustom, [TMsgDlgBtn.mbOK], 0,
procedure(const AResult: TModalResult)
begin
TAndroidHelperClass.openGooglePlayByAppPackage('com.google.zxing.client.android');
end);
exit;
end
else BarcodeChecked := true;
finally
list.Free;
end;
{$ENDIF}
end;