Dies hast du auch schon gecheckt ?
Delphi-Quellcode:
function LaunchActivityForResult(
const Intent: JIntent; RequestCode: Integer): Boolean;
var
ResolveInfo: JResolveInfo;
begin
ResolveInfo := SharedActivity.getPackageManager.resolveActivity(Intent, 0);
Result := ResolveInfo <>
nil;
if Result
then
SharedActivity.startActivityForResult(Intent, RequestCode);
end;
//For more info see https://github.com/zxing/zxing/wiki/Scanning-Via-Intent
procedure LaunchQRScanner(RequestCode: Integer);
var
Intent: JIntent;
begin
Intent := TJIntent.JavaClass.init(StringToJString('
com.google.zxing.client.android.SCAN'));
Intent.setPackage(StringToJString('
com.google.zxing.client.android'));
// If you want to target QR codes
//Intent.putExtra(StringToJString('SCAN_MODE'), StringToJString('QR_CODE_MODE'));
if not LaunchActivityForResult(Intent, RequestCode)
then
Toast('
Cannot display QR scanner', ShortToast);
end;
Rollo