In this section we discuss the triggers that enables your app to detect and react to Bidco tags.

Merchants use the Bidco Merchant API to generate tags for their products, catalogs, coupons and Acts and then place the tags on their eCommerce sites and in printed media for their customers to interact with.

Once implemented, your app will be able to retrieve the workflows associated with these tags.

The tag types currently supported are:

  • Barcode - A QR code that has been encoded with the information needed to retrieve a workflow.
  • Touch To Buy - When viewing a merchants eCommerce site on a Mobile device a button is visible instead of a QR code. This button is used to retrieve the workflow.
  • NFC - Android devices can scan tiny NFC chips that have been embedded in product labels, posters or any physical real-world object. These chips are encoded with the relevant information to retrieve the workflow.

Detecting Barcode Tags

  1. Barcode tag detection requires use of the system camera and optionally the flash. Add the following entry to your manifest to grant the application the necessary permissions and features:
<uses-permission android:name="android.permission.CAMERA">
<uses-permission android:name="android.permission.FLASHLIGHT">

<uses-feature android:name="" >
<uses-feature android:name="">
<uses-feature android:name="">

  1. Add the BarcodeTagDetectorView to your layout XML:

  1. Find the BarcodeTagDetectorView and set a BarcodeTagDetectorViewListener to be notified of events:
protected void onCreate(final Bundle savedInstanceState) {
	barcodeTagDetectorView = (BarcodeTagDetectorView) findViewById(;
	barcodeTagDetectorView.setBarcodeTagDetectorViewListener(new BarcodeTagDetectorViewListener() {
		public void onBarcodeTagDetected(final BarcodeTagDetectorView barcodeTagDetectorView,final Tag barcodeTag, final Image image, final List<PointF> barcodeRegion) {
			showAlertDialog("Bidco Barcode tag Detected", barcodeTag.getReference());
		public void onNonPowaTagBarcodeDetected(final BarcodeTagDetectorView barcodeTagDetectorView, final Barcode barcode, final Image image, final List<PointF> barcodeRegion) {
			 // Some other kind of barcode unsupported by Bidco was detected.
			 showAlertDialog("Unsupported Barcode Detected", barcode.getCode());
		public void onDetectorStarted(final BarcodeTagDetectorView barcodeTagDetectorView) {
			// Camera feed is live.
		public void onDetectorStopped(final BarcodeTagDetectorView barcodeTagDetectorView,final PowaTagException exception) {
		 if (exception != null) {
			// Detector stopped due to an error.
			showAlertDialog("Exception!", exception.getMessage());

  1. Call startDetection and stopDetection from appropriate lifecycle methods in your Activity:
protected void onResume() {

protected void onPause() {

  1. To check if the barcode tag detector is actively listening for tags use:

Detecting "Touch to Buy" Tags

  1. Touch to Buy tag detection requires the following entry in your manifest:
	<action android:name="android.intent.action.VIEW" />

	<category android:name="android.intent.category.DEFAULT" />
	<category android:name="android.intent.category.BROWSABLE" />

	<data android:host=""
		android:scheme="bidcodemo" />

Note: An example scheme is being implemented here. This should be replaced with the scheme you are using.

  1. Create an instance of the AppLinkTagDetector
Set<String> schemes = new HashSet<>();
AppLinkTagDetector detector = new AppLinkTagDetector(schemes);

AppLink appLink = detector.detectAppLink(intent);
if (appLink != null) {

Detecting NFC Tags

  1. NFC tag detection requires the use of the NFC system hardware. Add the following entry to your manifest to grant the application the necessary permissions and features:
<uses-permission android:name="android.permission.NFC" >
<uses-feature android:name="android.hardware.nfc" >
  1. Use the NfcTagDetector class to obtain the tag:
protected void onNewIntent(final Intent intent) {
	Set<String> schemes = new HashSet<>();
	NfcTagDetector nfcTagDetector = new NfcTagDetector(schemes);
	Tag ntag = nfcTagDetector.detectNfcTag(intent);
	if (ntag != null) {

Note: An example scheme is being implemented here. This should be replaced with the scheme you are using.

Next Steps

Use the Bidco tag to retrieve the associated workflow.


To explore this topic in more detail, including package imports and trigger implementation, import the sample app and review the ScanActivity class.