Search code examples
androidc++zxingcode128gs1-128

Zxing: Differentiate 128 barcodes and GSI-128


Using C++ Builder 10.1 Berlin, I'm developping an app to scan barcodes on an Android device. To get a barcode I call the ZXing app by Intent. When I scan a GSI-128 barcode, the return type is CODE-128. In my app, the processing is different depending on the type of barcode (128 and GSI-128).

Is there a method to differentiate these types of barcode?


Solution

  • Before calling the Intent with startActivityForResult(intent,0);, just add an argument with intent->putExtra(StringToJString("ASSUME_GS1"), true);. If the barcode is a GS1-128, the prefix "]C1" would be add at your barcode.

    _di_JIntent intent;
    msgID = TMessageManager::DefaultManager->SubscribeToMessage(__classid(TMessageResultNotification), &retourScanTel);
    intent = TJIntent::Create();
    intent->setAction(StringToJString("com.google.zxing.client.android.SCAN"));
    intent->putExtra(StringToJString("ASSUME_GS1"), true);
    SharedActivity()->startActivityForResult(intent,0);