Print Touch - Printer NFC Details

Anonymous (not verified) -
3 MIN READ
563
1

Zebra Link-OS Print Touch enables effortless device pairing and app launching by leveraging Near Field Communication. With Print Touch, you can pair Link-OS and NFC enabled devices to get you up and printing quickly.

Simplify the use of devices with Print Touch by creating apps that launch at a touch to ensure users get quick access to the data they need.

NFC OVERVIEW

Near Field Communication (NFC) is a set of short-range wireless technologies, typically requiring a distance of 4cm or less to initiate a connection. NFC allows you to share small payloads of data between an NFC tag and an Android-powered device, or between two Android-powered devices. The technology allows transferring of small amounts of data between two devices in close proximity.

NFC is an extension of RFID. While RFID waves can have very long ranges, NFC was set to a limited range of communication. Due to the short range, it is ideal to apply NFC in secure applications like payment. NFC has another advantage as it allows two-way communication, while RFID is a one-way reading technology.

This same technology can be found on our latest Zebra products. We have included an NFC tag with printer information that allows users to simply bump their Android and iOS devices to those printers to create a connection and print out their labels from the application. NFC Data Exchange in the format of “NDEF Records”, the standard method to store data in NFC tag is as follows:

The NFC tag embedded in the Zebra Printers contains printer information stored as NDEF record in the following format :

http://www.zebra.com/apps/r/nfc?mB=aabbccddeeff&mW=000000000000&mE=aabbccddeeff&c=123456789012345&s=12345678901234&v=0

HOW NFC TAGS ARE DISPATCHED TO APPLICATIONS

1. Before you can access a device’s NFC hardware and properly handle NFC intents, declare these items in your AndroidManifest.xml file

  • The NFC element to access the NFC hardware :

2. To start your application when an NFC tag is scanned, your application can filter the NFC intents in the Android manifest.

 

   

   

   

      android:path="/apps/r/nfc" />

   

      android:path="/apps/r/nfc" />

 

3. The example below will obtain the printer information from the NFC tag and try to established a connection with the printer (using Link-OS SDK for Android).

Parcelable[] scannedTags = intent.getParcelableArrayExtra(NfcAdapter.EXTRA_NDEF_MESSAGES);

  if (scannedTags != null && scannedTags.length > 0) {

    NdefMessage msg = (NdefMessage) scannedTags[0];

    final String payload = new String(msg.getRecords()[0].getPayload());

    new AsyncTask() {

      protected Void doInBackground(Void... params) {

        try {

            UrlPrinterDiscoverer.findPrinters(payload, new DiscoveryHandler() {

              public void foundPrinter(DiscoveredPrinter printer) {

                try {

                  Connection conn = printer.getConnection();

                  conn.open();

                  ZebraPrinterFactory.getInstance(conn).printConfigurationLabel();

                  conn.close();

                } catch (Exception e) { e.printStackTrace(); }

            }});

        } catch (DiscoveryException e) {

            e.printStackTrace();

        }

        return null;

      }

    }.execute((Void) null);

    intent.removeExtra(NfcAdapter.EXTRA_NDEF_MESSAGES);

  }

}

PRINT TOUCH WEB PAGE

We’ve covered how a developer can incorporate Print Touch to trigger their apps to establish a connection with a Link-OS printer when a user touches their NFC device with the printer. But if there is no app utilizing Print Touch on the user’s NFC device, the user will still be able to benefit from Print Touch.

The printer will pass its unique URL into the NFC device allowing it to display the printer’s own webpage. The webpage will feature links to useful information such as printer registration, product support, knowledge base articles, and various how-to videos. With these capabilities, Print Touch is a powerful Link-OS feature that will enhance the user’s experience.

MORE ABOUT NFC

Near Field Communications World maintains a list of mobile phones with NFC

NFC Tag in Zebra printer has a Virtual Tag Lock. So, you can re-encode the tag for your custom applications

Robin West

Solution Architect

Zebra ISV

profile

Anonymous (not verified)

Please Register or Login to post a reply

1 Replies

P Petr Kaminsky

Hi.

Great article! I have problem with my printer (ZD620). It beams (via NFC) BT MAC address within different parameter than described here. URL looks like:

<a href="http://...mBL=aabbccddeeff/">http://...mBL=aabbccddeeff</a&gt;....

instead of

<a href="http://...mB=aabbccddeeff/">http://...mB=aabbccddeeff</a&gt;...

Looking into Zebra SDK sources I found out also here relies on hardcoded "mB".
UrlPrinterDiscoverer.findPrinters()
ZSDK 2.0.5152

Is there any documentation on this topic?

Regards,
Petr.